middleware redirect doesn't change the url on router.refresh() - App Router #65970
Labels
bug
Issue was opened via the bug report template.
locked
Middleware
Related to Next.js Middleware
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Link to the code that reproduces this issue
https://github.com/Saman-Safaei-Dev/next-bug
To Reproduce
1- create a middleware to redirect from "/" to "/dashboard" with a condition ( for example when a cookie exists )
2- navigate to "/" and make this condition true, then call router.refresh()
3- you are in dashboard page but look at the url
Current vs. Expected behavior
current: the url remains the "/"
expected: the url should change to "/dashboard"
Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware, Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: