diff --git a/client/admin/src/app/auth.guard.ts b/client/admin/src/app/auth.guard.ts index 77c732b..c8bf95b 100644 --- a/client/admin/src/app/auth.guard.ts +++ b/client/admin/src/app/auth.guard.ts @@ -7,12 +7,16 @@ export const AuthGuard: CanActivateFn = (route, state) => { const authSvc: AuthService = inject(AuthService); if (sessionStorage.getItem('jwt') == null) { let success = false; - authSvc.refresh().subscribe((event) => { - if (event?.status == 200) { - success = true; - } - }); - router.navigate(['/login']); + authSvc.refresh().subscribe( + (event) => { + if (event?.status == 200) { + success = true; + } + }, + (err) => { + router.navigate(['/login']); + }, + ); return success; } else { return true;