Angular2: how to "reload" page with router (recheck canActivate)?

Viewed 2236

I have routers with canActivate: [ AuthGuard ] and validation inside AuthGuard

How to force check canActivate in same router url ?

For example: Current route is /admin and I have got event like session expired. I have session check in AuthGuard but this check activates only when I execute .navigate(...). How to force run canActivate in same location?

I've tried: this.router.navigate([ this.router.url ]); but angular checks same location and do nothing.

p.s. I can locate to "login page" or other pages when I got session expired event, but I have all redirects inside AuthGuard and I do not want to repeat the same redirects in all other events, I need just like location.reload() but in Angular2 routes.

Main question sounds like: How to force rerun canActivate guards in current location?

1 Answers
Related