How to make _middleware wait for token refresh before validating? #4206
Unanswered
DonHuskini
asked this question in
Help
Replies: 1 comment
-
Have u managed to fix this? Posted the same issue #5406 |
Beta Was this translation helpful? Give feedback.
0 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.
-
I have a custom backend with accessToken and refreshToken. When the accessToken expires, I try to refresh it. I added the logic to refresh the access token on the jwt callback, however, the _middleware doesn't wait for the session or token to be updated so when I access the token param on the _middleware, it contains the old data and then user is redirected to /login.
Do you know how can I fix it?
[...nextauth].js
/pages/me/_middleware.ts
Beta Was this translation helpful? Give feedback.
All reactions