How to check if a user is logged in?

Hi im trying to make something like a checkout page in my app and i need to know if the user is logged in so i can either continue the checkout or send him in the log in page.
Does anyone know how i can check if the user is already logged in?

In my web app im using firebase auth

Maybe you can set a Local Storage Variable Boolean set it true when the user login and set it false when he logged out… Or set it in DB (be careful to not block the user)

Yeah but do we know if something like that is “safe”?

In Local Storage, no, but in Firestore DB yes since youc can set the security rules.

1 Like