Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Environment Variable AUTH_URL #660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dexhowl
Copy link

@dexhowl dexhowl commented Apr 29, 2024

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.

Auth.js version 5 defines AUTH_URL automatically based on request headers. Getting rid of this line prevents users from seeing this warning upon completing Chapter 15.

Env URL basePath redundant
Copy link

vercel bot commented Apr 29, 2024

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

Copy link

vercel bot commented Apr 29, 2024

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

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant