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
HashLocationStrategy does not change hash when redirecting in canActivate Guard #37048
Labels
area: router
freq2: medium
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
router: LocationStrategy
router: navigation pipe
events/scheduleNavigation/transitions observable
state: confirmed
type: bug/fix
Milestone
Comments
atscott
added
router: LocationStrategy
state: confirmed
triage #1
router: navigation pipe
events/scheduleNavigation/transitions observable
labels
May 27, 2020
any update on this? |
jelbourn
added
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
and removed
severity3: broken
labels
Oct 1, 2020
martinsik
added a commit
to martinsik/angular
that referenced
this issue
Jan 13, 2021
…lTree from guard This situation can probably happen only when using HashLocationStrategy and by manually changing hash that triggers route guards that return a new UrlTree. Then hash in the browser might not match the current route because navigation was canceled, while hash in the URL remained set by the user. Fixes angular#37048
14 tasks
martinsik
added a commit
to martinsik/angular
that referenced
this issue
Jan 27, 2021
…rategy This situation can probably happen only when using HashLocationStrategy and by manually changing hash that triggers a route guard that returns a new UrlTree. Then hash in the browser might not match the current route because navigation was canceled, while hash in the URL remained set by the user. Related to angular#37048
atscott
pushed a commit
to martinsik/angular
that referenced
this issue
Apr 14, 2021
This situation can probably happen only when using `HashLocationStrategy` and by manually changing hash that triggers a route guard that returns a new `UrlTree`. Then hash in the browser might not match the current route because navigation was canceled, while hash in the URL remained set by the user. Related to angular#37048
atscott
pushed a commit
to martinsik/angular
that referenced
this issue
Apr 14, 2021
This situation can probably happen only when using `HashLocationStrategy` and by manually changing hash that triggers a route guard that returns a new `UrlTree`. Then hash in the browser might not match the current route because navigation was canceled, while hash in the URL remained set by the user. Related to angular#37048
zarend
pushed a commit
that referenced
this issue
Apr 15, 2021
…40409) This situation can probably happen only when using `HashLocationStrategy` and by manually changing hash that triggers a route guard that returns a new `UrlTree`. Then hash in the browser might not match the current route because navigation was canceled, while hash in the URL remained set by the user. Related to #37048 PR Close #40409
zarend
pushed a commit
that referenced
this issue
Apr 15, 2021
…40409) This situation can probably happen only when using `HashLocationStrategy` and by manually changing hash that triggers a route guard that returns a new `UrlTree`. Then hash in the browser might not match the current route because navigation was canceled, while hash in the URL remained set by the user. Related to #37048 PR Close #40409
zarend
pushed a commit
that referenced
this issue
Apr 15, 2021
…40409) This situation can probably happen only when using `HashLocationStrategy` and by manually changing hash that triggers a route guard that returns a new `UrlTree`. Then hash in the browser might not match the current route because navigation was canceled, while hash in the URL remained set by the user. Related to #37048 PR Close #40409
Resolved by a combination of #43102 and #43424 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: router
freq2: medium
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
router: LocationStrategy
router: navigation pipe
events/scheduleNavigation/transitions observable
state: confirmed
type: bug/fix
🐞 bug report
Affected Package
The issue is caused by package @angular/routerIs this a regression?
No, at least I can confirm that this issue was also present in version 8 of AngularDescription
Please have a look at the reproduction example at Stackblitz. The issue can be reproduced as follows:
.../#/bar
and hit Enter OR change the location by enteringlocation.href = '#/bar
in the console./start
).../#/bar
even though we have been redirected to/start
.🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-ivy-bejfwf
🌍 Your Environment
Angular Version:
Anything else relevant?
I tried to find the issue within the router code and it seems that
this.browserUrlTree
still points to/start
on this lines: https://github.com/angular/angular/blob/acf6075ca9aa92121bb0166b2b7560aeb2c167ff/packages/router/src/router.ts#L474..L475Therefore the angular router detects that the state of the application does not need to change (which is correct) but we still would need to change the URL to the one we redirected to.
The text was updated successfully, but these errors were encountered: