Bogdan M.
Bogdan M.

Reputation: 1726

Firebase user gets logged out after a couple of days

I've added email&password, google, facebook authentication in my application. However, I noticed that after some time passes (1,2 days maybe) firebase.getAuth() returns null. Please note that I haven't called firebase.unauth() anywhere in the code, it seems like the authenticated session expires after some time. Is there a way to make the session not expire after few days? I can think of 2 solutions but both seem bad to me:

Is there a built-in mechanism to achive the above? Thanks!

Upvotes: 0

Views: 2391

Answers (1)

André Kool
André Kool

Reputation: 4978

Solution number 3 and also the cause of this issue. In your firebase dashboard on the Login & Auth tab you can set the session length, default is 24 or 48 hours i think.

So if it's set at 24 hours all sessions will expire after 24 hours like you are seeing right now. But you can change this to 6 months for example.

enter image description here

Upvotes: 2

Related Questions