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 I do this, I get a 500 error saying that baseURL is required. Even though I can see that NEXT_PUBLIC_AUTH0_BASE_URL is correctly set in my logs, the library seems to not recognize it.
Additionally, the docs suggest that you can use $VERCEL_BRANCH_URL for branch preview URLs, however this variable is undefined and I can't find it mentioned in the Vercel System Environment Variables (perhaps deprecated?)
Assign "Preview" environment variables on Vercel, with exception of AUTH0_BASE_URL
Add .env.production file as shown above
Configure Auth0 to allow *.vercel.app callback URLs / logout URLs
npx vercel deploy and follow prompts
Open preview URL and attempt login
Additional context
If I change the .env.production file to set AUTH0_BASE_URL instead of NEXT_PUBLIC_AUTH0_BASE_URL then I can log in as expected (only on "commit" style preview URLs, not the branch preview URLs)
I'm not sure why this happens because this library appears to check both variables:
Checklist
Description
The docs say that for Vercel Preview deployments you should set:
(source)
When I do this, I get a 500 error saying that
baseURL
is required. Even though I can see thatNEXT_PUBLIC_AUTH0_BASE_URL
is correctly set in my logs, the library seems to not recognize it.Additionally, the docs suggest that you can use $VERCEL_BRANCH_URL for branch preview URLs, however this variable is undefined and I can't find it mentioned in the Vercel System Environment Variables (perhaps deprecated?)
Reproduction
AUTH0_BASE_URL
.env.production
file as shown above*.vercel.app
callback URLs / logout URLsnpx vercel deploy
and follow promptsAdditional context
If I change the
.env.production
file to setAUTH0_BASE_URL
instead ofNEXT_PUBLIC_AUTH0_BASE_URL
then I can log in as expected (only on "commit" style preview URLs, not the branch preview URLs)I'm not sure why this happens because this library appears to check both variables:
nextjs-auth0/src/config.ts
Line 492 in 5989b32
Perhaps the environment variables behavior has changed in recent Next.js versions.
nextjs-auth0 version
2.5.0
Next.js version
13.4.1
Node.js version
18.16.0
The text was updated successfully, but these errors were encountered: