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

fix: return null in unstable_getServerSession if there's an error #5218

Merged

Conversation

melanieseltzer
Copy link
Contributor

☕️ Reasoning

Make sure unstable_getServerSession returns null if there's a config error underneath. Previously in that scenario, it was returning a string of the error page HTML (see linked issue for details).

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Fixes: #5166

📌 Resources

@vercel
Copy link

vercel bot commented Aug 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
next-auth ⬜️ Ignored (Inspect) Aug 31, 2022 at 1:13AM (UTC)

Copy link
Member

@ThangHuuVu ThangHuuVu left a comment

Choose a reason for hiding this comment

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

Thanks, added 2 comments, let me know what you think 🙌

packages/next-auth/tests/getServerSession.test.ts Outdated Show resolved Hide resolved
packages/next-auth/src/next/index.ts Outdated Show resolved Hide resolved
@melanieseltzer melanieseltzer force-pushed the fix-bug-unstable_getServerSession branch from 601090f to 1b5e6a6 Compare August 31, 2022 01:13
@melanieseltzer
Copy link
Contributor Author

Thanks for the review @ThangHuuVu, have addressed your comments 😄

Copy link
Member

@ThangHuuVu ThangHuuVu left a comment

Choose a reason for hiding this comment

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

Awesome, let's land this @melanieseltzer 🚀

@ThangHuuVu ThangHuuVu merged commit a82cbf5 into nextauthjs:main Aug 31, 2022
@melanieseltzer melanieseltzer deleted the fix-bug-unstable_getServerSession branch August 31, 2022 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core`
Projects
None yet
2 participants