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

Custom pages (/signIn) do not work correctly #12370

Open
TDanyStark opened this issue Dec 11, 2024 · 0 comments
Open

Custom pages (/signIn) do not work correctly #12370

TDanyStark opened this issue Dec 11, 2024 · 0 comments
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@TDanyStark
Copy link

TDanyStark commented Dec 11, 2024

Environment

"next-auth": "^5.0.0-beta.25",

Reproduction URL

https://github.com/TDanyStark/practice-nextjs/blob/b103cb45cb09d42f04c8c67013e33ebf012d6336/auth.config.ts#L5

Describe the issue

Describe the issue
I followed the next.js guide
https://nextjs.org/learn/dashboard-app/adding-authentication

when I try to access /dashboard the middleware redirects to
https://practice-nextjs-three-ruddy.vercel.app/login?callbackUrl=https%3A%2F%2Fpractice-nextjs-three-ruddy.vercel.app%2Fdashboard
for now, the expected behavior

then I login with email and password (credentials) my app redirects to the view /dashboard, However, I still see in the URL
https://practice-nextjs-three-ruddy.vercel.app/login?callbackUrl=https%3A%2F%2Fpractice-nextjs-three-ruddy.vercel.app%2Fdashboard

How to reproduce

1.try to access to the protected route
https://practice-nextjs-three-ruddy.vercel.app/dashboard
image

2.Login with
Email: [email protected]
Password: 123456

3.See the view /dashboard, and the URL /login?callbackUrl=https%3A%2F%2Fpractice-nextjs-three-ruddy.vercel.app%2Fdashboard ,
image

4.Try click in the SignOut Button, it don't work, because the URL is not correct
image

5.If you reload the page, Now, you can see the /dashboard view and the /dashboard url.
image

6.And, now try click the SignOut Button, now it works
image

Expected behavior

When I login, the URL must change to the correct URL in this example /dashboard

@TDanyStark TDanyStark added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Dec 11, 2024
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

1 participant