router
router copied to clipboard
beforeEach guard not changing URL after user uses back button
Reproduction
https://codesandbox.io/s/epic-dew-cgwffy
Steps to reproduce the bug
- Click on login
- Click on logout
- Click on the browser back button
Expected behavior
After the router intercepts the route, the new URL should be the one I am returning on the beforEach callback.
Actual behavior
The URL is staying as the one it was redirected from.
Additional information
In my actual app, no matter how many times I hit the back button, the URL stays on the route that the router redirected from i.e. the from.fullPath from the beforeEach guard.
I am using version 4.2.1 on my app. It seems it's the same as #916, and the temporal fix also works in this case. The implemented fix (#921) however, doesn't to solve my situation.
You are being redirected to the Home page because that’s what you return in the navigation guard
You are being redirected to the Home page because that’s what you return in the navigation guard
The component being rendered is Home, but the route is /about @posva
I'm having the exact same problem described in this issue. I don't understand why it was closed so soon
I opened https://github.com/vuejs/router/pull/2133 with a workaround.