Reputation: 1726
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:
firebase.authWithOAuthToken()
again and again when the session has become unauthorizedIs there a built-in mechanism to achive the above? Thanks!
Upvotes: 0
Views: 2391
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.
Upvotes: 2