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

feat: add basePath option #9686

Merged
merged 7 commits into from
Jan 19, 2024
Merged

feat: add basePath option #9686

merged 7 commits into from
Jan 19, 2024

Conversation

balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Jan 19, 2024

The previous URL parsing has been too loose so a new option is needed to tell Auth.js which paths are valid. This is done by passing a new basePath option.

We can now refer to this value internally when calculating redirect URLs for errors, or valid signin/callback URLs for providers.

Frameworks can set their own preferred default basePath (eg.: for NextAuth.js we will keep it as /api/auth for backwards compatibility, but other frameworks might just use /auth for consistency.)

In frameworks, this option can also be inferred from AUTH_URL (NEXTAUTH_URL) as it's been done before

The name basePath was chosen to match this existing option with the same name in next-auth

Copy link

vercel bot commented Jan 19, 2024

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

2 Ignored Deployments
Name Status Preview Updated (UTC)
auth-docs ⬜️ Ignored (Inspect) Jan 19, 2024 3:14pm
next-auth-docs ⬜️ Ignored (Inspect) Jan 19, 2024 3:14pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant