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
When using next-auth in a Next.js middleware, the token is retrieved correctly in the local environment but returns null when deployed to Vercel. "next-auth": "^5.0.0-beta.18",
How to reproduce
Configure next-auth in a Next.js application.
Set up a custom middleware to use getToken.
Deploy the application to Vercel.
Observe that the token is null in the middleware logs in the Vercel deployment, while it is correctly retrieved in the local environment.
Expected behavior
The token should be retrieved correctly in both local and production environments.
The text was updated successfully, but these errors were encountered:
TanzimHossain2
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
May 30, 2024
TanzimHossain2
changed the title
next-auth Middleware Fails to Retrieve Token in Production (Vercel Deployment)next-auth v(5) Middleware Fails to Retrieve Token in Production (Vercel Deployment)
May 30, 2024
Environment
Reproduction URL
https://github.com/TanzimHossain2/LwsKart
Describe the issue
When using
next-auth
in a Next.js middleware, the token is retrieved correctly in the local environment but returnsnull
when deployed to Vercel."next-auth": "^5.0.0-beta.18",
How to reproduce
next-auth
in a Next.js application.getToken
.null
in the middleware logs in the Vercel deployment, while it is correctly retrieved in the local environment.Expected behavior
The token should be retrieved correctly in both local and production environments.
Logs from Local Environment
Logs from Vercel Deployment
The text was updated successfully, but these errors were encountered: