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

refactor(core): allow trusting the forwarded host header #5561

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

revmischa
Copy link
Contributor

NOTE:

  • It's a good idea to open an issue first to discuss potential changes.
  • Please make sure that you are NOT opening a PR to fix a potential security vulnerability. Instead, please follow the Security guidelines to disclose the issue to us confidentially.

☕️ Reasoning

I want to forward a host header in CloudFront, I'm not using Vercel. It's needed for requests to a lambda function URL.

Source: https://github.com/jetbridge/cdk-nextjs

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Please scout and link issues that might be solved by this PR.

Fixes: INSERT_ISSUE_LINK_HERE

📌 Resources

@vercel
Copy link

vercel bot commented Oct 12, 2022

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

1 Ignored Deployment
Name Status Preview Updated
next-auth ⬜️ Ignored (Inspect) Oct 12, 2022 at 8:20PM (UTC)

@github-actions github-actions bot added the core Refers to `@auth/core` label Oct 12, 2022
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, I was actually going to do this in https://github.com/nextauthjs/next-auth/pull/5536/files#diff-3cc6ded936a2c02c746c1d933414fb001e90fc06df7792e24b725a66e354d951R1

But we can probably land this faster. Would you mind renaming it to AUTH_TRUST_HOST?

For now, I am OK if we don't document this, so if needed, we can iterate on the approach (most likely won't have to, but unless documented, we can just say something is not intended to be used 👍)

Co-authored-by: Balázs Orbán <info@balazsorban.com>
@revmischa revmischa requested review from balazsorban44 and removed request for ThangHuuVu October 12, 2022 20:21
@balazsorban44 balazsorban44 changed the title Non vercel-specific way to forward host header refactor(core): allow trusting the forwarded host header Oct 13, 2022
@balazsorban44 balazsorban44 merged commit 6758e1c into nextauthjs:main Oct 15, 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.

None yet

2 participants