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

Use relative URL for Signin page callbackUrl #4534

Merged
merged 4 commits into from May 31, 2022

Conversation

bboyz269
Copy link
Contributor

@bboyz269 bboyz269 commented May 9, 2022

☕️ Reasoning

As of now, there's no way to determine actual address (protocol, host, port) which end-user access next app within middleware functions. Sign in page 's callbackUrl does not behave as expected when next app is behind ssl proxy or load balancer.

As a simple fix, using relative URL for callbackUrl would restore the expected behavior.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Fixes: #4483

📌 Resources

@vercel
Copy link

vercel bot commented May 9, 2022

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

1 Ignored Deployment
Name Status Preview Updated
next-auth ⬜️ Ignored (Inspect) May 27, 2022 at 2:50AM (UTC)

@github-actions github-actions bot added the core Refers to `@auth/core` label May 9, 2022
apps/dev/components/header.js Outdated Show resolved Hide resolved
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.

LGTM! @ndom91 @balazsorban44 do you have any concerns?

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!

@balazsorban44 balazsorban44 merged commit 75602a3 into nextauthjs:main May 31, 2022
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.

Incorrect callbackUrl appended when securing page with middleware withAuth
3 participants