After deployment, the middleware does not reissue the access token. #61935
Unanswered
qjrjsel
asked this question in
App Router
Replies: 2 comments
-
please... 🥲 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I believe I am experiencing the same issue as you do, but my middleware simply does not run on production, so it also wont ever re-issue the access token. See my question, that I've asked here: #62283 Unfortunately there was no answer so far either 🥲 |
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
-
hello.
When the current access token expires, middleware.ts reissues the access token and sets it as a cookie.
Currently, the value for the access token is well displayed in the console, and the access token is reissued normally after the first deployment.
It will not be reissued after a certain period of time.
In the local environment, reissues are being carried out consistently.
What's the problem?
- middleware.ts
alreadyRedirected If this cookie does not exist, an "ERROR TOO MANY REDIRECTS" error occurs, so I created this cookie.
Also, if a cookie was created in the existing response, the access token cookie creation did not work properly, so a new response was created through redirect.
const newResponse = NextResponse.redirect(request.nextUrl.clone());
Also, if a cookie was created in the existing response, the access token cookie creation did not work properly, so a new response was created through redirect.
The problem is that after adding console logging and redeploying and operating again, cookies are injected normally.
If I try to operate it again after some time has passed, the access token does not work properly.
It works consistently well in the local environment.
Beta Was this translation helpful? Give feedback.
All reactions