let user go to home without session token

This commit is contained in:
Blair Vanderlugt 2021-04-23 17:14:21 -07:00
parent 2ae44a781a
commit e6be3efd9b
2 changed files with 10 additions and 8 deletions

View File

@ -12,12 +12,13 @@ export class AuthGuard implements CanActivate {
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if (sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'))) {
return true;
}
//if (sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'))) {
// return true;
//}
this.router.navigate(['/auth']);
return false;
//this.router.navigate(['/auth']);
//return false;
return true;
}
}

View File

@ -96,19 +96,20 @@ export class AuthService {
login(): boolean {
if (this.sessionToken !== undefined) {
try {
this.getWithToken();
//this.getWithToken();
return true;
} catch (e) {
this.loggingService.sendErrorLevelMessage('Login token failed', this, {error: e});
}
} else {
try {
this.getChallenge();
// this.getChallenge();
return true
} catch (e) {
this.loggingService.sendErrorLevelMessage('Login challenge failed', this, {error: e});
}
}
return false;
//return false;
}