Next.js Discord

Discord Forum

NEXTAUTH ENV variable available but not see by nextauth.

Unanswered
ASittingDuck posted this in #help-forum
Open in Discord
I am working with NEXTAUTH and I have defined the NEXTAUTH_SECRET variable, and it even is available to the backend API, but when I run it on production on AWS, even though I am able to see it on the API call, NEXTAUTH is saying there is no secret defined. I am now going to MANUALLY set the set to look at process.env.NEXTAUTH_SECRET but my understanding was that if you set that particiular env variable that NEXTAUTH will just see that.

3 Replies

do you use Docker? running on k8s?
if so, it’s a bit complicated as Next.js pre-render pages on building a docker image then cache in .next then container gets env variables from some where else depending on Cloud services such as AWS, GCP and Azure.
most probably your api is cached one