diff --git a/support-portal-frontend/src/app/app-routing.module.ts b/support-portal-frontend/src/app/app-routing.module.ts index 79556d4..c72ecaa 100644 --- a/support-portal-frontend/src/app/app-routing.module.ts +++ b/support-portal-frontend/src/app/app-routing.module.ts @@ -3,11 +3,12 @@ import {RouterModule, Routes} from "@angular/router"; import {LoginComponent} from "./component/login/login.component"; import {RegisterComponent} from "./component/register/register.component"; import {UserComponent} from "./component/user/user.component"; +import {AuthenticationGuard} from "./guard/authentication.guard"; export const routes: Routes = [ {path: 'login', component: LoginComponent}, {path: 'register', component: RegisterComponent}, - {path: 'user/management', component: UserComponent}, + {path: 'user/management', component: UserComponent, canActivate: [AuthenticationGuard]}, {path: '', redirectTo: '/login', pathMatch: 'full'} ]; diff --git a/support-portal-frontend/src/app/guard/authentication.guard.ts b/support-portal-frontend/src/app/guard/authentication.guard.ts index 2ea6e60..4025f06 100644 --- a/support-portal-frontend/src/app/guard/authentication.guard.ts +++ b/support-portal-frontend/src/app/guard/authentication.guard.ts @@ -29,7 +29,7 @@ export class AuthenticationGuard implements CanActivate { else { this.router.navigate(['/login']); - this.notificationService.notify(NotificationType.ERROR, `You need to log in to access this page`.toUpperCase()); + this.notificationService.notify(NotificationType.ERROR, `You need to log in to access this page`); return false; }