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

Return 204 from /api/auth/me when logged out [SDK-3564] #791

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

Widcket
Copy link
Contributor

@Widcket Widcket commented Aug 25, 2022

⚠️ This PR contains breaking changes

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

📋 Changes

Previously the profile API route, by default at /api/auth/me, would return a 401 error when the user was not authenticated. While it was technically the right status code for the situation, it showed up in the browser console as an error.

This PR makes it return a 204 instead. Since 204 is a successful status code, it will not produce a console error.

📎 References

Fixes #430 #720

🎯 Testing

The unit tests were updated, and also the changes were tested manually using the kitchen sink example.

@Widcket Widcket added the CH: Breaking Change PR contains breaking changes without a major version bump label Aug 25, 2022
@vercel
Copy link

vercel bot commented Aug 25, 2022

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

1 Ignored Deployment
Name Status Preview Updated
nextjs-auth0 ⬜️ Ignored (Inspect) Aug 25, 2022 at 5:13PM (UTC)

@Widcket Widcket marked this pull request as ready for review August 25, 2022 17:13
@Widcket Widcket requested a review from a team as a code owner August 25, 2022 17:13
@Widcket Widcket merged commit 3939ef3 into vNext Aug 25, 2022
@Widcket Widcket deleted the feature/204-profile-response branch August 25, 2022 17:16
@adamjmcgrath adamjmcgrath mentioned this pull request Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Breaking Change PR contains breaking changes without a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants