-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Refresh token is not updated in jwt callback with SvelteKit #9305
Comments
It seems like the refetch interval is not working an svelte client side? The authjs.session-token is not updated... I saw, that there is a similar issue: #7111 |
even with @auth/core 0.4.0 the session cookie is not updated... Is there another problem with sveltekit at all? |
I've also downgraded the svelte version, "svelte": "^3.59.2", Problem persists |
I've tried to "hack" some code, to get this working. So I tired to handoff the value https://github.com/naimo84/authjs-refreshtoken/blob/main/authjs/index.js#L217 This is now working as excepted. But feels really bad ;) |
@naimo84 I solved this this way: #8034 (comment) I'm thinking about opening a PR for it |
This will not only solve the problem of refresh token but also open the doors for much needed feature - update session object from client to server without having user to logout! |
Would love a PR of this! Otherwise, it seems we've gotten to the bottom of this issue, I'm going to close soon unless someone has any objections 🙏 EDIT: I put it together myself (#9497), but I'm having issues with the |
This feature's been merged in #9694 a while ago 🙏 |
Provider type
Authentik
Environment
System:
OS: macOS 14.0
CPU: (8) arm64 Apple M2
Memory: 67.88 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.8.1 - ~/.nvm/versions/node/v20.8.1/bin/node
npm: 10.1.0 - ~/.nvm/versions/node/v20.8.1/bin/npm
pnpm: 8.10.5 - /opt/homebrew/bin/pnpm
bun: 1.0.13 - ~/.bun/bin/bun
Browsers:
Brave Browser: 119.1.60.125
Chrome: 119.0.6045.199
Safari: 17.0
npmPackages:
@auth/core: ^0.18.4 => 0.18.4
@auth/sveltekit: ^0.3.15 => 0.3.15
Reproduction URL
https://github.com/naimo84/authjs-refreshtoken
Describe the issue
Hey guys,
I'm trying to implement auth.js with my goauthentik Server. Login and getting a Access_token for my User works fine. Even the first rotation with the refresh_token works. But: after getting the first refreshed access_token, somethings wrong. The
input token in the jwt callback function is an old one (I2cgJ0NXYYMR4SDuxzmQGysDcMQbNa0Rf9gJfQM5D.....), as the can see in the logs. I don't know what's going wrong. I've copied the hooks.server.js Code from here, https://authjs.dev/guides/basics/refresh-token-rotation, tried some code changes. But nothing helps.
If you need an user in my goauthentik, please let me know.
Perhaps I'm missing something?
Thanks a lot in advance.
Greets,
Benjamin
Logs:
How to reproduce
Expected behavior
Seeing only the last fetched refresh_token
The text was updated successfully, but these errors were encountered: