From 398d471ea1f1eef47e1f328f18368ae5e14a71a9 Mon Sep 17 00:00:00 2001 From: hoa3 Date: Tue, 9 Apr 2024 17:45:48 +0200 Subject: [PATCH] feat: fix routing --- frontend/src/app/app-routing.module.ts | 5 +---- frontend/src/app/authentication-guard.guard.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 6571719..abf0d67 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -52,10 +52,7 @@ const routes: Routes = [ { path: 'institution-popup', component: InstitutionPopupComponent, - }, - { - path: 'institution-popup/:institution-popup', - component: InstitutionPopupComponent, + canActivate: [AuthenticationGuard] }, { path: 'login', diff --git a/frontend/src/app/authentication-guard.guard.ts b/frontend/src/app/authentication-guard.guard.ts index 87581d9..5bad75f 100644 --- a/frontend/src/app/authentication-guard.guard.ts +++ b/frontend/src/app/authentication-guard.guard.ts @@ -31,7 +31,7 @@ export class AuthenticationGuard implements CanActivate, CanActivateChild, CanLo private authenticate(): boolean { if (!this.authService.isUserLoggedIn()) { - this.router.navigateByUrl("/institution-popup"); + this.router.navigateByUrl("/login"); return false; } else { return true;