You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Middleware problem in Vercel, Next Auth V5, "message": "There was a problem with the server configuration. Check the server logs for more information."
#11780
Closed
rodrigc opened this issue
Sep 5, 2024
· 3 comments
Everything works fine when testing locally on my laptop.
When I deploy to Vercel, I see in my debugging that console.log(req.auth); shows:
Session: undefined
Auth object: {
message: 'There was a problem with the server configuration. Check the server logs for more information.'
}
How to reproduce
Deploy to vercel
vercel deploy --target=preview
Access the URL of the application
Look at the Vercel logs
Expected behavior
req.auth and req.auth.user should be correctly populated
The text was updated successfully, but these errors were encountered:
rodrigc
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Sep 5, 2024
I did some more debugging, and discovered that in a Vercel deployment,
the AUTH_SECRET variable was not being picked up from the .env file in my repository, and was not being set. This was the source of the problem.
Environment
Reproduction URL
https://github.com/rodrigc/next-auth-v5
Describe the issue
I'm having the same problem reported by @ephraim888sun in #10137 and #10136.
I also mentioned the problem in jherr/next-auth-v5#1 , but I think that this might be a next-auth bug, so reporting here also.
I am testing it out now, and I am having a problem when trying to run in Vercel.
console.log(req.auth);
shows:How to reproduce
Expected behavior
req.auth and req.auth.user should be correctly populated
The text was updated successfully, but these errors were encountered: