I have developed a VUE SPA that uses Auth0 authentication and authorization platform.
I used @auth0/auth0-spa-js
implementing also social logins.
This VUE SPA works fine except for the following scenario that, sadly, for some users/clients is quite common.
- Using the login button the user authenticates and is correctly redirected to a general page
- VUE protected routes, on the client-side, and REST API with a protection middleware based on JWT, rules access to “reserved” portions of the VUE SPA
- finally, the user closes the browser, without logging off!!!
- later on (authentication token expires after 90’, here I’m meaning after at least this amount of time), the user re-open the browser and tries to log in again
This causes the following error:
authorize:1 Failed to load resource: the server responded with a status of 400 ()
What is wrong with it? How to fix this issue?
Below further details (some fields replaced with XXX):
- SDK is regarding: @auth0/auth0-spa-js
- SDK Version: 1.15.0
- Node: 14.17.0