Closed
Description
Checklist
- The issue can be reproduced in the nextjs-auth0 sample app (or N/A).I have looked into the API documentation and have not found a suitable solution or answer.I have searched the issues and have not found a suitable solution or answer.I have searched the Auth0 Community forums and have not found a suitable solution or answer.I agree to the terms within the Auth0 Code of Conduct.
Description
When upgrading from nextjs-auth0 v3 to v4, I observed an issue where the idToken is not preserved during session migration. This causes unintended user logouts after upgrading.
The problematic code appears clearly at:
https://github.com/auth0/nextjs-auth0/blob/7bd83988caa15c89f3e7169e28dea4e820e9efc4/src/server/session/normalize-session.ts#L125C10-L131C14
Could you please clarify whether this omission is intentional? If this is not intentional, I'd be happy to submit a PR to address this issue.
Thank you!
Reproduction
- Start the application using nextjs-auth0 v3 and log in.
- Switch to a branch with v4 and upgrade the dependencies.
- Reload the application and observe that the idToken is no longer present in the session.
Additional context
No response
nextjs-auth0 version
4.6.0
Next.js version
15.2.4
Node.js version
v20.12.0
Activity
frederikprijck commentedon May 26, 2025
Hey, not intentional. Happy to look at a PR to solve it if you prefer. Let me know if not, then I can address this.
Fix Missing idToken during Session Migration from v3 to v4 auth0#2116
KentoMoriwaki commentedon May 27, 2025
@frederikprijck Thanks for your comment. I created a PR #2120
Fix Missing idToken during Session Migration from v3 to v4 auth0#2116
Fix Missing idToken during Session Migration from v3 to v4 #2116 (#2120)
tusharpandey13 commentedon May 30, 2025
Thanks for the PR, it has been merged and will be released in the next minor release!