I am using the auth0-spa-js SDK with VueJS.
When my application is navigating between pages I want to have the router navigation guard check to determine:
- Has a user already been authenticated?
- Is the current JWT the user has still valid?
auth0-spa-js has a couple methods that look like they could be used for this purpose:
- getTokenSilently
- isAuthenticated (which is really a wrapper around getUser).
My question is: Which of these would be better suited to this purpose?
isAuthenticated seems simpler, but I'm not sure if it checks whether the user's JWT is expired or not.