Credentials Provider Refresh Token Rotation - jwt callback token doesn't update after initial sign in. #2850
Unanswered
jan-grasewicz
asked this question in
Help
Replies: 2 comments 18 replies
-
The following topic looks similar and it doesn't seem to be any solution since May :( |
Beta Was this translation helpful? Give feedback.
0 replies
-
When used server-side though, you should pass In the future, we likely will have a |
Beta Was this translation helpful? Give feedback.
18 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
Hi.
I'm trying to setup refresh token rotation using Credentials Provider.
Based on this example: https://next-auth.js.org/v3/tutorials/refresh-token-rotation
Unfortunate jwt callback saves returned token only on initial sign in and when getSession is called client-side, not when getSession is called in getServerSideProps function.
So my access token gets refreshed as long as I do client-side requests, but if I fetch all my data server-side my session will expire.
Am I doing something wrong in my config, or is it a bug?
How to reproduce ☕️
[...nextauth].js
"refreshAccessToken" always returns new tokens, but on subsequent calls "jwt(token)" returns them only if refresh was the result of "getSession" called client-side, not in getServerSideProps
I'm using v3, but tried v4 with no success.
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions