Answer the question
In order to leave comments, you need to log in
Session storage React, Firebase. How to organize?
I am writing a training project on React as a database and use Firebase for authorization.
Authorized users have access to a personal account with unique content for each, which must be pulled from the database.
When you reload the page, you have to log in again. Right now I'm thinking what are the options for organizing session storage.
A simple way that comes to mind is storing data of the type in localstorage:
- isAuth: true / false
as well as a unique id that Firebase gives:
uid: NcefVvDqfHXqrj0IlvzfmLb2
Draw private pages by flag, pull the necessary information about the user from the database by id.
But in this case, the user is technically sort of not logged in after reloading the page...
What are the options to organize this process?
Thanks in advance for your advice.
Answer the question
In order to leave comments, you need to log in
An easy way that comes to mind is storing data like this in localstorage:
- isAuth: true/false
as well as a unique id given by Firebase:
uid: NcefVvDqfHXqrj0IlvzfmLb2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question