In Auth0-SPA-JS, what happened to `expiresIn` that was in the `parseHash` result of `auth0.js`?

Question: In Auth0-SPA-JS, what happened to expiresIn that was in the parseHash result of auth0.js?

Solution:

After calling getTokenSilently, the access_token.exp claim comes back with the token. The property expiresIn would actually be equivalent to access_token.exp + now.

That said, you shouldn’t need it anymore – the SPA SDK will hit Auth0 and see if there is a valid token and return it, otherwise it will prompt the user to log in again. It will also cache a valid token for you in memory. auth0.js didn’t do all this, so you needed to manually check for expiration and renew the token. With the new SPA SDK, you don’t need to do that. :tada:

Supporting Documentation:

1 Like