You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using NextAuth with a custom basePath configuration in the SessionProvider, internal NextAuth endpoints (like _log) appear to make requests to the default /api/auth path instead of respecting the configured custom path.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Describe the issue
When using NextAuth with a custom
basePath
configuration in theSessionProvider
, internal NextAuth endpoints (like_log
) appear to make requests to the default/api/auth
path instead of respecting the configured custom path.Setup
NextAuth route location:
app/next-api/auth/[...nextauth]/route.ts
SessionProvider configuration:
Environment variable:
Expected behavior
All NextAuth internal requests should use the configured
basePath
(/next-api/auth/_log
,/next-api/auth/_error
, etc.)Actual behavior
NextAuth internal endpoints make requests to
/api/auth/_log
,/api/auth/_error
instead of the configured basePath.Reproduction
app/next-api/auth/[...nextauth]/route.ts
)SessionProvider
withbasePath="/next-api/auth"
NEXTAUTH_URL=http://localhost:3000/next-api/auth
/api/auth/_log
Questions
Is this expected behavior? Should NextAuth internal endpoints respect the
basePath
configuration?Is there additional configuration required? Are we missing a configuration option that would make internal endpoints use the custom basePath?
Beta Was this translation helpful? Give feedback.
All reactions