You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 643584b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(vue-router): render the redirect target when a guard redirects (#31510)
Issue number: internal
---------
## What is the current behavior?
Currently, when a guard returns a location instead of `false` during a
back navigation, the URL updates to the redirect target but Ionic
renders a different page. A redirect doesn't fail, so the original
navigation never reaches `afterEach` or `onError`. Its staged delta and
params are never cleared and get applied to the redirect target instead.
## What is the new behavior?
The ownership `beforeEach` now discards the state a navigation claimed
when a guard redirects it. We match it through `redirectedFrom`, which
vue-router points at the first location in the redirect chain. That
covers leave guards, which run before our hook, and a guard redirect to
the current page, which fails as a duplicate before reaching
`beforeEach`.
## Does this introduce a breaking change?
- [ ] Yes
- [X] No
## Other information
This was [raised while reviewing
#31364](#31364 (comment))
and left out of scope there.
0 commit comments