I have an angular app with .net core back-end. I am using windows active directory for user authorization/identification. Everything is working, but I have a feeling that the app is slow... I have confirmed that this is happening because because I am checking is user valid on each component load.
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> {
if (this.auth.isAuthenticated) {
return true;
} else {
return this.router.parseUrl('/notAuthorized');
}
});
"isAuthenticated" is a method which is calling a back-end and checking is user valid or not.
So, any suggestion about a best practice for handling this kind of situation?