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

Next.js: Passwords refetch server data but Next.js keeps the current URL #58

Open
xixixao opened this issue Aug 20, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@xixixao
Copy link
Contributor

xixixao commented Aug 20, 2024

See https://discord.com/channels/1019350475847499849/1275574839218016337

This is not great. We could try using router.refresh instead of calling a server action, but I had trouble getting it to work correctly when unmounting the auth provider.

@xixixao xixixao added the bug Something isn't working label Aug 20, 2024
@andreaselia
Copy link

andreaselia commented Aug 20, 2024

After playing around with this, router.push works but router.refresh doesn't for getting the browser URL to change as well as handle the redirect too.

signIn("password", data).then(() => router.push("/tasks"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants