From f5c69cc574f986e7c85c67ae3cdb1382c55d92db Mon Sep 17 00:00:00 2001 From: Spencer Ofwiti Date: Fri, 25 Jun 2021 11:03:00 +0300 Subject: [PATCH] Revert auth guard handler. --- src/app/_interceptors/error.interceptor.ts | 2 +- src/app/app-routing.module.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/_interceptors/error.interceptor.ts b/src/app/_interceptors/error.interceptor.ts index a2fb8cc..31e3812 100644 --- a/src/app/_interceptors/error.interceptor.ts +++ b/src/app/_interceptors/error.interceptor.ts @@ -56,7 +56,7 @@ export class ErrorInterceptor implements HttpInterceptor { this.loggingService.sendErrorLevelMessage(errorMessage, this, { error: err }); switch (err.status) { case 401: // unauthorized - // this.router.navigateByUrl('/auth').then(); + this.router.navigateByUrl('/auth').then(); break; case 403: // forbidden alert('Access to resource is not allowed!'); diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 421f7b6..93e5328 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,7 +7,7 @@ const routes: Routes = [ { path: '', loadChildren: () => import('@pages/pages.module').then((m) => m.PagesModule), - canActivate: [], + canActivate: [AuthGuard], }, { path: '**', redirectTo: '', pathMatch: 'full' }, ];