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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide NEXTAUTH_SECRET via options to withAuth #4838
Comments
Just curious, how do you provide environment variables to your code then? |
They are encrypted in the repo and are getting decrypted at runtime (decryption secret is provided via env var). We save them as .env file. But because vercel middleware does not support .env files (because Reasons:
|
Sounds good then, thanks for explaining! I think we can consider this. 馃憤 Changes needed are here:
And the wording in the docs: https://next-auth.js.org/configuration/nextjs#prerequisites https://next-auth.js.org/configuration/options#nextauth_secret Especially the last one, as we should probably not consider removing this option after all. Want to open a PR? 馃檪 |
Yes. Will open a PR in the next few days :) |
PR created |
@balazsorban44 Thank you very much. This was a great developer experience. Really quick answers and merge 馃ぉ. Keep up the great work :) |
Pls am a beginner my withAuth file is not passing the any secret, the page is just blank |
My withAuth Component//////////////////////////////////////////////////////////// export default function (Component) {
} |
class Secret extends React.Component {
} export default withAuth(Secret) |
Description 馃摀
NextAuth
has the possibility to get the secret passed by its options. It would be great to have that forwithAuth
, too. CurrentlywithAuth
only accepts the secret via env vars. We don't store our secrets in env vars and now we have to patchprocess.env
to getwithAuth
to run.I'm happy to create a PR. Just wanted to know upfront if there is any reason why secret can not be passed to
withAuth
.How to reproduce 鈽曪笍
Possible in
NextAuth
:Would be great to have this, too:
Contributing 馃檶馃徑
Yes, I am willing to help implement this feature in a PR
The text was updated successfully, but these errors were encountered: