From 23d262303afd13ec6b60f64017967ebe61df4ba6 Mon Sep 17 00:00:00 2001 From: Spencer Ofwiti Date: Mon, 14 Jun 2021 17:03:17 +0300 Subject: [PATCH] Refactor auth guard to use session token. --- src/app/_guards/auth.guard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/_guards/auth.guard.ts b/src/app/_guards/auth.guard.ts index 395d37b..f2383ec 100644 --- a/src/app/_guards/auth.guard.ts +++ b/src/app/_guards/auth.guard.ts @@ -39,7 +39,7 @@ export class AuthGuard implements CanActivate { route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): Observable | Promise | boolean | UrlTree { - if (localStorage.getItem(btoa('CICADA_PRIVATE_KEY'))) { + if (sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'))) { return true; } this.router.navigate(['/auth']);