I’m trying to implement a flow using auth0/nextjs in which I add the access token in the header of API calls. Currently using getAccessToken method for this.
The idea is to call getAccessToken and if it fails (token expired), then:
- Get a refresh token
- Use the refresh token to obtain a new access token
- Use this new access token
When trying to get a refresh token by following the docs, I’m noticing that the we should include a state parameter in the request to /authorize. My question is how/where would I obtain the state parameter when calling the /authorize endpoint on the server-side?