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

URL Not Updating After Login in NextAuth.js v5 (Next.js 15, React 19) #12711

Open
hashirshoaeb opened this issue Feb 26, 2025 · 1 comment
Open
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@hashirshoaeb
Copy link

hashirshoaeb commented Feb 26, 2025

Environment

  System:
    OS: macOS 15.3.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 79.27 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.5.0 - ~/.nvm/versions/node/v23.5.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v23.5.0/bin/npm
  Browsers:
    Chrome: 133.0.6943.55
    Safari: 18.3
  npmPackages:
    next: 15.1.2 => 15.1.2 
    next-auth: ^5.0.0-beta.25 => 5.0.0-beta.25 
    react: 19.0.0 => 19.0.0 

Reproduction URL

https://github.com/hashirshoaeb/next-auth-test-app

Describe the issue

I’m experiencing an issue where the page visually updates after login, but the URL remains stuck on /login. Additionally, signing out does not work unless the page is manually refreshed. It started happening after upgrading Next.js, NextAuth.js, and React to the latest versions.

Previously Working Setup:

"dev": "next dev",
node: 18
"next": "^14.0.3",
"next-auth": "^5.0.0-beta.13",
"react": "18.2.0",

Updated Setup (Causing Issue):

"dev": "next dev --turbopack",
node: 22
"next": "15.1.2",
"next-auth": "^5.0.0-beta.25",
"react": "19.0.0",

#12697 looks similar issue.

How to reproduce

Steps to Reproduce:

  1. use the example link from Reproduction URL
  2. Run npm install
  3. Run npx auth secret or put your AUTH_SECRET to the .env file
  4. Run the app npm run dev
  5. Visit /login and sign in.
  6. The page visually changes to the home page, but the URL remains stuck at /login.
  7. Clicking “Sign Out” at this point does nothing.
  8. Manually refreshing the page updates the URL correctly to /, and the sign-out button starts working.

I have recorded a demo video to explain the issue.

Screen.Recording.2025-02-27.at.12.07.31.AM.mov

Expected behavior

  • After logging in, the URL should update correctly to / without requiring a manual refresh.
  • The sign-out button should function properly without needing a hard refresh.
@hashirshoaeb hashirshoaeb added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Feb 26, 2025
@Coding-faizan

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

2 participants