I’ve added in auth0.js to my single page application. I have login and logout working and to make authenticated requests to my API I’m passing along the access token in the header of each request.
However, I noticed that my access tokens have an expiration associated with them.
My question is what is the prescribed way to deal with getting new access tokens so that the user can continue to make API requests?
From reading through the docs it seems that calling checkSession is the appropriate way to get a new access token? I’m currently just calling checkSession a few minutes before the access token expires to get a new access token. Is this the correct way to deal with access token expiration?