Hi all, I have a Vue app that I’ve got working well with Auth0 bar one bit. Since changing cacheLocation to localStorage, the Require log in after setting in the Auth0 settings page has no affect.
I want my application to automatically log users out after 480mins.
The page itself is not showing any data which is good as I’ve got refresh token expiration set to 480mins too but it’s not ideal that a user is still logged in.
Changing the cacheLocation to localStorage means that tokens persist even after the browser refreshes. However, while this approach provides some benefits, one downside is the token expiration handling since Auth0’s in-memory cache will respect the “Require log in after” setting. Still, when you switch to localStorage , it does not automatically handle that. Your method is a viable solution for the problem you’ve described. To fine-tune it you may want to consider background token renewal with the usage of checkSession method from the Auth0 SDK and Clear Auth0 Data as a good practice, you can do this by redirecting the user to Auth0’s logout URL.
If you found this post helpful or interesting, please give it a like Your interaction makes a difference. Have a wonderful day!