Intermediary page being show in production mode #11159
Unanswered
DanielAtCosmicDNA
asked this question in
Help
Replies: 2 comments
-
Try setting custom signin pages in your auth/[...nextauth] route If user is logged out it should use the custom signin page. From there if the error persists it would be clear it is realted to the session or the middleware |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Ali-Raza764, It is set right here: https://github.com/DanielAtCosmicDNA/next-auth-dev/blob/main/middleware.js#L5. pages: {
signIn: '/'
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment
System:
OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz
Memory: 10.25 GB / 15.53 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
pnpm: 9.1.4 - ~/.local/share/pnpm/pnpm
Browsers:
Chromium: 125.0.6422.141
npmPackages:
next: 14.2.3 => 14.2.3
next-auth: ^4.24.7 => 4.24.7
react: ^18 => 18.3.1
Reproduction URL
https://github.com/DanielAtCosmicDNA/next-auth-dev
Describe the issue
When running with
yarn dev
, Oauth login works perfectly fine. But when running in production withyarn build && yarn start
, an intermediary page is rendered upon login.How to reproduce
Copy .env.example to .env, set the environment variables for GitHub and Google providers, and a NEXTAUTH_SECRET. Additionally set a mongodb database URL.
run "yarn build && yarn start"
open localhost:3000, click on GitHub oauth login.
Observe the intermediary page in between.
Expected behavior
In production it should work the same way it works when running as

yarn dev
without any intermediary page. Here is the intermediary page and which should not be there:Beta Was this translation helpful? Give feedback.
All reactions