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
I'm having an issue with Auth.js (NextAuth) v5 in my Next.js application when deploying with Dokploy on my VPS server. The providers' URLs are showing localhost:3000 instead of my production domain.
Environment:
Next.js 15
Auth.js (NextAuth) v5
Deployed using Dokploy
Running behind Cloudflare proxy
Issue:
When I check the /api/auth/providers endpoint in production, it shows:
{
"google": {
"id": "google",
"name": "Google",
"type": "oidc",
"signinUrl": "http://localhost:3000/api/auth/signin/google",
"callbackUrl": "http://localhost:3000/api/auth/callback/google"
}
}
Expected behavior:The URLs should show my production domain instead of localhost:3000.How can I make Auth.js use my production domain instead of localhost while avoiding the Cloudflare error?ps: cloudflare set to FULL ssl/tls### Current vs. Expected behaviorWhat I've tried:Setting environment variables:NEXT_PUBLIC_APP_URL=https://mydomain.comAUTH_SECRET=[my-secret]AUTH_TRUST_HOST=trueThe same setup works correctly when deployed to Vercel, but fails on my VPS server deployment.When I add AUTH_URL=https://mydomain.com to env in production:The providers show the correct domain:
{
"google": {
"id": "google",
"name": "Google",
"type": "oidc",
"signinUrl": "http://mydomain.com/api/auth/signin/google",
"callbackUrl": "http://mydomain.com/api/auth/callback/google"
}
}
BUT Cloudflare returns error 10000 on the homepage### Provide environment information```bashNEXT_PUBLIC_APP_URL=https://mydomain.comAUTH_SECRET=[my-secret]AUTH_TRUST_HOST=trueAUTH_URL=https://mydomain.com
Which area(s) are affected? (Select all that apply)
Installation, Application, Traefik, Docker, Remote server
Are you deploying the applications where Dokploy is installed or on a remote server?
Remote server
Additional context
Ubuntu 22.04 LTC
Will you send a PR to fix it?
No
The text was updated successfully, but these errors were encountered:
To Reproduce
I'm having an issue with Auth.js (NextAuth) v5 in my Next.js application when deploying with Dokploy on my VPS server. The providers' URLs are showing localhost:3000 instead of my production domain.
Environment:
Issue:
When I check the
/api/auth/providers
endpoint in production, it shows:Which area(s) are affected? (Select all that apply)
Installation, Application, Traefik, Docker, Remote server
Are you deploying the applications where Dokploy is installed or on a remote server?
Remote server
Additional context
Ubuntu 22.04 LTC
Will you send a PR to fix it?
No
The text was updated successfully, but these errors were encountered: