Navigation Menu

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

Secret Option in Middleware #4846

Merged

Conversation

sean-nicholas
Copy link
Contributor

☕️ Reasoning

This PR adds the possibility to set the secret (NEXTAUTH_SECRET) in the middleware options. Not every setup is able to provide the secret via env vars. At my company we save our secrets encrypted in git and decrypt them at runtime. We could patch process.env but this seems not a good solution.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Fixes: #4838

📌 Resources

@vercel
Copy link

vercel bot commented Jul 5, 2022

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

Name Status Preview Updated
next-auth ✅ Ready (Inspect) Visit Preview Jul 7, 2022 at 0:15AM (UTC)

@github-actions github-actions bot added the core Refers to `@auth/core` label Jul 5, 2022
@vercel vercel bot temporarily deployed to Preview July 5, 2022 21:00 Inactive
@sean-nicholas
Copy link
Contributor Author

  • I couldn't find automated tests for my changes. If you point me to them, I'm happy to fix them. I tested it manually with apps/dev.
  • I'm not a native english speaker, so the docs might need some minor tweaks. Happy to assist here, too :)

@vercel vercel bot temporarily deployed to Preview July 5, 2022 21:04 Inactive
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.

Thank you!

@balazsorban44 balazsorban44 merged commit c59a4e0 into nextauthjs:main Jul 7, 2022
@vercel vercel bot temporarily deployed to Preview July 7, 2022 12:15 Inactive
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.

Provide NEXTAUTH_SECRET via options to withAuth
2 participants