let user go to home without session token
This commit is contained in:
parent
2ae44a781a
commit
e6be3efd9b
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user