if I have the following implementation of CanActivate in an AuthGuard:
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
let token = localStorage.getItem('token');
if (token) {
this.authService.userInfo(token, (err, result) => {
if (err) return false;
return true;
}
}
return false;
}
Will the guard wait until the callback function executes, knowing that userInfo
below actually uses HTTP to call Auth0.