next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Remove Environment Variable AUTH_URL

Open dexhowl opened this issue 1 year ago • 2 comments

Upon completing Chapter 15 I received this warning. [auth][warn][env-url-basepath-redundant] Read more: https://warnings.authjs.dev#env-url-basepath-redundant

After investigating a little I found that Auth.js version 5 infers AUTH_URL automatically based on request headers and has defined this environment variable as mostly unnecessary.

AUTH_URL This environment variable is mostly unnecessary with v5 as the host is inferred from the request headers. However, if you are >using a different base path, you can set this environment variable as well. For example, AUTH_URL=http://localhost:3000/web/>auth or AUTH_URL=https://company.com/app1/auth

Getting rid of this line from my .env file removes the warning and everything still works like normal when logging in/out.

I'm hoping that removing it from the example file will prevent others from going through the same confusion I did with this problem.

dexhowl avatar Apr 29 '24 03:04 dexhowl

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-learn-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2024 3:24am
next-seo-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2024 3:24am

vercel[bot] avatar Apr 29 '24 03:04 vercel[bot]

@dexhowl is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 29 '24 03:04 vercel[bot]