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
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
Current behavior
If the permissions guard is configured with a redirect, and the permissions test fails, the guard uses the Router service to navigate to the configured route.
Expected behavior
As of Angular 7.1, router guards can return a boolean or an instance of UrlTree. By returning a UrlTree instead of using the router to do the navigation, we can prioritize redirects when there are multiple guards applied to a route, both with competing redirects.
Minimal reproduction of the problem with instructions
The code above will navigate to the "unauthorized" route instead of "login", even though the authGuard guard has priority.
Environment
Angular version: 17.1.1
ngx-permissions version: 17.1.0
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
- [x] Brave version 1.69.160
The text was updated successfully, but these errors were encountered:
I should add, as a workaround for the time being, I've made use of bothcanMatch and canActivate route guards on the routes that are affected. I've used my authGuard w/ canMatch and ngxPermissionsGuard with canActivate.
I'm submitting a...
Current behavior
If the permissions guard is configured with a redirect, and the permissions test fails, the guard uses the
Router
service to navigate to the configured route.Expected behavior
As of Angular 7.1, router guards can return a boolean or an instance of
UrlTree
. By returning aUrlTree
instead of using the router to do the navigation, we can prioritize redirects when there are multiple guards applied to a route, both with competing redirects.Minimal reproduction of the problem with instructions
The code above will navigate to the "unauthorized" route instead of "login", even though the
authGuard
guard has priority.Environment
The text was updated successfully, but these errors were encountered: