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(core): invalid url error when using custom error page #11381

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

apteryxxyz
Copy link
Contributor

☕️ Reasoning

When a configuration error occurs and there is a custom error page (pages.error config option), @auth/core does not currently prepend the url origin to the path before passing it to Response.redirect, resulting in an invalid URL error.
image
Passing the full URL into the pages.error config option would fix this.
This PR copys the URL building code used to handle other error types, and adds it to the configuration error handling.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

Copy link

vercel bot commented Jul 13, 2024

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

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 4:09am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 4:09am

Copy link

vercel bot commented Jul 13, 2024

@apteryxxyz is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@ThangHuuVu
Copy link
Member

@apteryxxyz Could you open an issue with a minimal reproduction first? 🙏

@balazsorban44
Copy link
Member

@ThangHuuVu I think this should be reasonable. On server-side, we don't have the origin url and relative redirects won't work, so I think OP is right.

@balazsorban44 balazsorban44 merged commit 4a8ab0f into nextauthjs:main Aug 9, 2024
5 of 6 checks passed
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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants