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
create-t3-app favors process.env.VERCEL_URL over process.env.NEXTAUTH_URL:
NEXTAUTH_URL: z.preprocess(// This makes Vercel deployments not fail if you don't set NEXTAUTH_URL// Since NextAuth.js automatically uses the VERCEL_URL if present.(str)=>process.env.VERCEL_URL??str,// VERCEL_URL doesn't include `https` so it cant be validated as a URLprocess.env.VERCEL ? z.string() : z.string().url(),),
I have set NEXTAUTH_URL to the proper URL on Vercel, but my env was referring to the deployment's domain instead of what I provided. It was very confusing because it was working fine for NextAuth but not in my code.
Reproduction repo
/
To reproduce
Setup a new create-t3-app
Set Vercel's NEXTAUTH_URL to an URL
Log that somewhere
Deploy
Notice how NEXTAUTH_URL is not what you provided to Vercel but VERCEL_URL
Additional information
No response
The text was updated successfully, but these errors were encountered:
Provide environment information
System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Pro
Memory: 140.14 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v18.17.0/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
pnpm: 9.1.0 - ~/.nvm/versions/node/v18.17.0/bin/pnpm
bun: 1.0.24 - ~/.bun/bin/bun
Describe the bug
create-t3-app favors
process.env.VERCEL_URL
overprocess.env.NEXTAUTH_URL
:But NextAuth favors
process.env.NEXTAUTH_URL
overprocess.env.VERCEL_URL
:I have set
NEXTAUTH_URL
to the proper URL on Vercel, but my env was referring to the deployment's domain instead of what I provided. It was very confusing because it was working fine for NextAuth but not in my code.Reproduction repo
/
To reproduce
NEXTAUTH_URL
to an URLNEXTAUTH_URL
is not what you provided to Vercel butVERCEL_URL
Additional information
No response
The text was updated successfully, but these errors were encountered: