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
feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called #24618
When there are multiple guards they will run async. If only one of them performs a router.navigateByUrl(url), there shouldn't be a problem. However, sometimes there are multiple guards that will perform a redirect and there isn't a good way to determine which is the primary one and which one should run.
We need an API that either allows redirects to be scheduled with priority, then "flushed" using the highest priority one, or we need to cancel other guards when a guard performs a redirect. Another option would be to collect info from all the guards and let the redirect be configured in a single place.
This isn't a very well-defined feature as I think it will take some looking at the current APIs and how the navigation flow works to see what's feasible without introducing wildly breaking changes.
changed the title [-]feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/-][+]GST-13 ⁃ feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/+]on Jul 19, 2018
changed the title [-]GST-13 ⁃ feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/-][+]feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/+]on Jul 26, 2018
Activity
[-]feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/-][+]GST-13 ⁃ feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/+][-]GST-13 ⁃ feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/-][+]feature(router): Provide a way to coalesce multiple failed guards so only a single redirect is called[/+]mohammedzamakhan commentedon Dec 11, 2018
Is there a documentation, on how to assign the highest priority redirect?
jasonaden commentedon Dec 11, 2018
@mohammedzamakhan There's a good article by @nathan-lapinski coming out that describes the behavior (his Medium page can be found here).
It looks like the best documentation we currently have on the prioritization is the tests for the
prioritizedGuardValueoperator: https://github.com/angular/angular/blob/master/packages/router/test/operators/prioritized_guard_value.spec.tsangular-automatic-lock-bot commentedon Sep 14, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.