-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
jwt rotation not working properly after browser close and open #498
Comments
I am not sure what the problem is.. but I modified directus code. I left my code for someone who faces same problem.
Don't set env variable. |
It's not solved.. And it's an old issue discussed many times in next-auth repo. I hope someday it will be solved. Then auth package can be more valuable |
I also face this issue.... |
same problem |
Same issue |
Hmm, interesting issue. As you pointed out it seems to be more related to authjs, then our module. I have used refresh tokens inside the JWT countless times before. I would follow these steps to continue with this issue:
However, as you already pointed our numerous issues in the nextauth repo, it may not be the fix. However, we are also now beginning the migration to authjs, which may fix this issue. Keep an eye on #673 for updates on this! |
Closed due to inactivity. |
Environment
Windows 10
Nuxi 3.6.5
Nuxt 3.6.5 with Nitro 2.4.1
@sidebase/nuxt-auth 0.4.4
next-auth 4.22.3
Reproduction
No response
Describe the bug
This is own my jwt refresh code.
This code works well until browser close.
But in some scenario, user can close browser and after 12 hours like enough expiration access token,
user can open browser again. Then the code refresh access_token and refresh_token automatically.
And then in jwt callback function, returns new access token and refresh token.
But somehow, the token is not updated correctly.
I don't know how I can fix it correctly but I can only figure the cookie is not updated.
frontend\node_modules@sidebase\nuxt-auth\dist\runtime\server\services\nuxtAuthHandler.mjs#125
This code is always runned when jwt callback run like refresh tab , open browser.
So it works well with refreshed tab while browser running.
But it's not working with two conditions.
Then as soon as browser open, the token is updated. And session-token cookie should be updated too matched new token. But somehow even if setCookie code was run, but cookie is still same as previous session-token cookie.
Maybe.. there might be bug with nuxt initialize code with cookie and update cookie after jwt callback logic.
Additional context
This cookie should be updated to browser cookie
But after code run, cookie is still same as before.
Logs
No response
The text was updated successfully, but these errors were encountered: