src/app/auth/auth.guard.ts
AuthGuard is responsible for navigating the user to /login when he is not currently logged in according to the AuthenticationsService. It's canActivate method is automatically invoked by angular on routing events.
Methods |
constructor(router: Router, authenticationService: AuthenticationService)
|
|||||||||
Defined in src/app/auth/auth.guard.ts:10
|
|||||||||
Parameters :
|
canActivate | ||||||||||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot)
|
||||||||||||
Defined in src/app/auth/auth.guard.ts:19
|
||||||||||||
Redirects user to login if he is not authenticated.
Parameters :
Returns :
boolean
true iff the user is logged in according to the AuthenticationService |