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(next-auth): proper handling of env for createActionURL #10950

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaellopez
Copy link

☕️ Reasoning

Next.js replaces environment variables at build time but they need to be reference directly and cannot be accessed dynamically for this to work. 3c035ec broke this contract.

This PR fixes this by changing the next-auth caller to extract the variables directly from process.env and putting them in an object compatible with createActionURL from core. Other frameworks might have other inner workings in regards to this env handling, so I only made the changes in next-auth rather than refactoring createActionURL which would've affected other frameworks I'm not familiar with.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

N/A

📌 Resources

Next.js replaces environment variables at build time but they need to be
reference directly and cannot be accessed dynamically for this to work.
Copy link

vercel bot commented May 18, 2024

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

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) May 18, 2024 6:57am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview May 18, 2024 6:57am

Copy link

vercel bot commented May 18, 2024

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

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant