3

In the response of (createUserWithEmailAndPassword or signInWithEmailAndPassword) we have _tokenResponse.expiresIn and it's equal to 3600 seconds

How to modify this value to a longer value like 30 days or something like that?

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
sudo-zaki
  • 31
  • 2

1 Answers1

3

The duration of that token cannot be changed and that does not mean the session has expired. Checkout Firebase 3.x - Token / Session Expiration.

It's just the access_token and you can get a new one using the refresh_token. Firebase Auth SDK does this for you under the hood. You just need to call getIdToken() and you get a valid token every time. Checkout How i get new access token when current access token has expired, google firebase auth? for more information.

If you use the session cookies, there you can specify the validity of the token set in the cookie (up to 14 days) but that's ideal for server side rendered web apps.

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84