Skip to content

Conversation

@Naptie
Copy link

@Naptie Naptie commented Dec 1, 2025

☕️ Reasoning

This PR fixes the incorrect assignment statement to the basePath setting in the frameworks-sveltekit package. It used to ignore the value set by the user and didn’t recognize the possible presence of the AUTH_URL environment variable, which, when set, caused the env-url-basepath-redundant warning to be spammed in the logs. In this PR, I moved the assignment statement into an if condition that checks if neither user-defined basePath nor the AUTH_URL is present, which is supposed to be the only case where basePath should be assigned a fallback value.

Also, due to inappropriate implementation of the coreSetEnvDefaults function, it is unclear if it is supposed to be run once or multiple times - the env-url-basepath-redundant warning is logged each time it finds both basePath and AUTH_URL are present, but following this check in the function it immediately assigns basePath to ensure it always has an value, causing all subsequent invocations of this function to annoyingly spam that warning in the console, as long as AUTH_URL is defined. Therefore, suppressBasePathWarning is now set to true when calling coreSetEnvDefaults to completely prevent that warning from being logged.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Fixes: #12795

📌 Resources

@Naptie Naptie requested a review from ThangHuuVu as a code owner December 1, 2025 14:50
@vercel
Copy link

vercel bot commented Dec 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
auth-docs Ready Ready Preview Comment Dec 1, 2025 2:53pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
next-auth-docs Ignored Ignored Preview Dec 1, 2025 2:53pm

@vercel
Copy link

vercel bot commented Dec 1, 2025

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

A member of the Team first needs to authorize it.

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Broken Link Checker

1 broken links found. Links organised below by source page, or page where they were found.

1) /getting-started/migrate-to-better-auth

Target Link Link Text
/docs "documentation"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redirects require redundant setting of auth_url when using sveltekit for hosted apps

1 participant