basePath feature breaks auth0 (and presumably authentik) provider #9744
Labels
bug
Something isn't working
invalid reproduction
The issue did not have a detectable valid reproduction URL
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Environment
Reproduction URL
https://github.com/nextauthjs/next-auth-example
Describe the issue
The recent addition of the #9686 has caused any provider that starts with auth (e.g. auth0, authentik) to break when using the default base path (/auth).
The problem is here: https://github.com/nextauthjs/next-auth/pull/9686/files#diff-e2783aeceecac8cd1b559372f242d520b894883a0c297fa4829ef4e5a5f35e88R134
pathname.split(base) represents '/auth/signin/auth0'.split('/auth') when using the Auth0 provider. As such the result of the operation is ['', '/signin', '0'] which causes the function to throw since there's an expected length of 2.
How to reproduce
Use auth0 provider with default base path.
Expected behavior
Does not fail to parse action.
The text was updated successfully, but these errors were encountered: