-
Question 💬Hello everyone, I have been stuck for hours on this issue! I have a nextAuth using app that works perfectly fine locally, but when I deploy it, it does not seem to see the NEXTAUTH_URL variable, and it redirects me to localhost:3000, as opposed to my domain. I feel like it's not accepting my environment variable. I verified other variables do work within the same file. I fixed similar issues for other variables by making them public, but of course that's not an option for NEXTAUTH_URL. I tried very hard to find a solution to this, but I couldn't find anything in other threads. Sorry in advance if I missed something! Please help! EDIT: I am deploying on Amazon Web Services, not Vercel. My NEXTAUTH_URL is my domain with a /map at the end (we want it to go to a page, not the base URL, on sign in.) My code for sign in is in a functional component. I cannot figure it out!
How to reproduce ☕️
Contributing 🙌🏽No, I am afraid I cannot help regarding this |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
That sounds like an issue with your deployment service. We only default to localhost when |
Beta Was this translation helpful? Give feedback.
-
For some more information, we are using kubernetes/AWS and docker. Like I said, I can have the browser console.log the NEXTAUTH_URL but it is seemly not accessible by next auth... Please help! |
Beta Was this translation helpful? Give feedback.
-
All, the answer for me here was making sure my docker image was built after specifying the environment variable via the command line. |
Beta Was this translation helpful? Give feedback.
All, the answer for me here was making sure my docker image was built after specifying the environment variable via the command line.