Refactor auth guard to use session token.

This commit is contained in:
Spencer Ofwiti 2021-06-14 17:03:17 +03:00
parent 472d9b2cd1
commit 23d262303a

View File

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