-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Next basePath not handled on signin page #9425
Comments
Behaviour is still present in in Next.js v14.1 and next-auth v5 beta.5 |
The next.config.js basePath cannot be propagated to NextAuth.js, so you need to manually add this as a prop to |
@balazsorban44 According to the types being shipped in beta.5, |
Not shipped yet but it's here
|
Okay, thank you. I'll keep an eye on the releases page for now. 😄 |
So, now, can I do for it? I must run Next 14 App router on sub directory, but fail becaus auth 5 not yet supported.. I have add in SessionProvider and in AuthConfig basePath:"/admin/api/auth" but still error |
@hscstudio I'm getting this same problem. Mine says in the logs |
Could you please elaborate a bit more how to set them up? |
Collection of workarounds I've found: |
Environment
System:
OS: macOS 14.2
CPU: (10) arm64 Apple M1 Pro
Memory: 149.20 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - ~/Library/Caches/fnm_multishells/2567_1703023890015/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 10.2.3 - ~/Library/Caches/fnm_multishells/2567_1703023890015/bin/npm
pnpm: 8.12.1 - /opt/homebrew/bin/pnpm
bun: 0.5.8 - ~/.bun/bin/bun
Browsers:
Chrome: 120.0.6099.109
Safari: 17.2
npmPackages:
next: 14.0.4 => 14.0.4
next-auth: 5.0.0-beta.4 => 5.0.0-beta.4
react: 18.2.0 => 18.2.0
Reproduction URL
https://github.com/marcoreni/next-auth-repro-base-path
Describe the issue
My application has a basePath configured on "next" side. However, this is not fully handled properly on Next.
Session call work, redirection to signin page works, but the form action does not contain the
How to reproduce
basePath
inside next.config.jsbasePath
inside session provider)(NOTE: the repro repository has been configured with a base path of "/foo". If you open http://localhost:3000/foo/middleware-example , you will be redirected on the login page, and clicking on the Github button will yield the problem)
Expected behavior
The form action URL should include the basePath.
The text was updated successfully, but these errors were encountered: