Comments (6)
Current workaround is to just set anything to AUTH_SECRET
during build time and change the env variable again during runtime. But yea this is very annoying.
from next-auth.
It is not even reading the secret while using npm next dev, the check for AUTH_SECRET should not be there until the app has been completely initialiazed, that means until the environment variables have been loaded (build time is bad for it also)
from next-auth.
Hi all,
Current workaround is to just set anything to AUTH_SECRET during build time
This would be my suggestion too. The reason for this is that some path in your code might be hit during prerendering (next build
) that relies on auth. This will result in the AUTH_SECRET
check invocation.
- You can set it to a dummy value, just make sure that the production version has a properly set secret. You can use
npx auth secret
for example. - Or you can try to figure out what invoked authentication. The missing secret check is already a runtime check.
It is not even reading the secret while using npm next dev,
This sounds unrelated and something specific to your project. Next.js reads environment variables as a priority so they should always be available before the dev server is initialized. I cannot tell more without seeing your code, but it's most likely nothing to do with Auth.js.
from next-auth.
I have the same issue with a turborepo project. AUTH_SECRET is set in an env file and is also included in turbo config.
It doesn't appear to be used. I presume pnpm dev
is using the env.local and the pnpm build
even when run locally is not using .env.local or not finding the value for some reason.
Rolling back to the previous beta version does resolve the issue for now
from next-auth.
I don't think the issue is resolved just yet @balazsorban44
from next-auth.
Please open a new issue with a minimal reproduction then. Please don't give a full monorepo that takes a lot of time to set up, please strip it down to the bare minimum that still reproduces the issue, if the monorepo setup is even relevant. if it reproduces without one, please provide a simple repo isntead.
Saying that it's not resolved is not actionable.
from next-auth.
Related Issues (20)
- Middleware in NextJS not working HOT 1
- customizing a built-in OAuth provider link dose not work HOT 1
- Cannot find module '@auth/prisma-adapter' from 'my.test.ts' HOT 1
- Cannot find module '@auth/prisma-adapter' from 'my.test.ts'
- Documentation for Drizzle Adapter has wrong schema HOT 4
- Broken link to AccessDenied error type HOT 1
- Drizzle adapter - edge HOT 1
- Unavailable Link in NextJS Learn Chapters HOT 1
- broken-link HOT 1
- Resend email provider does not create an entry in Account table HOT 3
- Postmark provider import is missing HOT 1
- Postmark provider import is missing HOT 1
- Postmark provider import is not working HOT 3
- session (network tab) does not persist in production if I refresh the page, but works fine in local development HOT 1
- Broken link pointing to https://authjs.dev/reference/nextjs#auth in https://authjs.dev/getting-started/migrating-to-v5#details HOT 1
- missing ethereum signin docs HOT 3
- [auth][cause]: OperationProcessingError: "response" is not a conform Token Endpoint response HOT 1
- Error: Module not found: Can't resolve 'crypto'" HOT 1
- test
- Issue with Custom SignIn Persistence: Failure to Detect Session Upon Returning After Inactivity.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-auth.