Skip to content
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

Cleanup global __NEXTAUTH state after unmount #4383

Merged

Conversation

skirsten
Copy link
Contributor

Re-mounting the component was not reloading the session because the global __NEXTAUTH was not cleaned up on unmount.

Reasoning 💡

#4252 (comment)

Checklist 🧢

  • [] Documentation
  • [] Tests
  • Ready to be merged

Note: If using reactStrictMode: true and using React 18 (vercel/next.js#35822) you will see two api/auth/session requests during next dev

@vercel
Copy link

vercel bot commented Apr 13, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/5ywBULmvvvwgZmsRxEDvRx3b3LCE
✅ Preview: Ignored

@github-actions github-actions bot added client Client related code core Refers to `@auth/core` labels Apr 13, 2022
@ubbe-xyz
Copy link
Collaborator

Thanks for the contribution 💚

This is, AFAIK on purpose, so the session is stored in memory so long as the application is running. @balazsorban44 is the one who knows the details of this though, let's wait for his feedback ☕️

Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this sounds good. 👍

@balazsorban44 balazsorban44 merged commit 58d06ed into nextauthjs:main Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related code core Refers to `@auth/core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants