I have a big problem and after hours of reading documents and solution I can't find how I will be able to solve this problem :
Basically I have in my angular guard this :
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
return this.checkLogin(route);
}
checkLogin(route) {
return this.authService.login().map(response => {
if (this.authService.isAuth) {
return this.authService.grants().map(grants => {
if (grants.canRead) {
return true;
}
})
}
});
}
What I want to do is first to call the service authService.login, and if I'm authentified then I call the authService.grants to check if the user can read this page or not.
As simple as that but I'm not being able to get into the second call I don't know why it's returning an observable.