-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give handleProfile an option to refresh the access token. #294
Comments
Hi @marklawlor
This is by design. You'd only need to use the
The original issue you've described looks valid though:
Which I'll take a look at |
@adamjmcgrath Ok makes sense. Yes the original issue is what I was experiencing, but as I was skimming the source code I got muddled on how to report it. Do you mind just clarifying my understanding around I assumed that if the user revisits my website with an expired access token, but valid refresh token then the But the design is the If I wished for a seamless experience then the work around is to do something like this?
|
Yes, this is the expected behaviour - you shouldn't need to do See https://github.com/auth0/nextjs-auth0/blob/main/src/session/get-access-token.ts#L109-L110, if the AT is expired and you have a RT then it should fetch you a new AT. If it's not working, I suspect you're hitting the issue you originally described - which I have a fix for in #307 |
Fixed by #307 - will be releasing this with a couple of other updates shortly |
Describe the problem
When using the
refetch
option withhandleProfile
, thegetAccessToken
function is called but without therefresh
option.It would be good for the handleProfile function to also refresh the user session, as this would work nicely with the
useUser
hook, allowing returning users to automatically get a refreshed session.This can also be achieved by calling
getAccessToken
beforehandleProfile
The text was updated successfully, but these errors were encountered: