From 43e424a9df4494da787b19b422201a1a729caaa1 Mon Sep 17 00:00:00 2001 From: Higunio320 Date: Sun, 17 Mar 2024 18:02:14 +0100 Subject: [PATCH 1/2] Added redirection to projects after login --- corn-frontend/src/app/pages/home/home.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corn-frontend/src/app/pages/home/home.component.ts b/corn-frontend/src/app/pages/home/home.component.ts index 071e1671..84e12bd8 100644 --- a/corn-frontend/src/app/pages/home/home.component.ts +++ b/corn-frontend/src/app/pages/home/home.component.ts @@ -36,7 +36,7 @@ export class HomeComponent implements OnInit { ngOnInit() { if (this.keycloak.isLoggedIn()) { //TODO implement proper auth guard - this.router.navigate(['/boards/backlog']); + this.router.navigate(['/projects']); } } From 9d97952477c502c88dec03b1cde0b3c2cd613d59 Mon Sep 17 00:00:00 2001 From: Higunio320 Date: Mon, 18 Mar 2024 17:32:36 +0100 Subject: [PATCH 2/2] Changed path to value from enum --- corn-frontend/src/app/core/enum/RouterPaths.ts | 3 +++ corn-frontend/src/app/pages/home/home.component.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/corn-frontend/src/app/core/enum/RouterPaths.ts b/corn-frontend/src/app/core/enum/RouterPaths.ts index 21c1ee0c..cabd99fd 100644 --- a/corn-frontend/src/app/core/enum/RouterPaths.ts +++ b/corn-frontend/src/app/core/enum/RouterPaths.ts @@ -5,6 +5,9 @@ export enum RouterPaths { HOME_DIRECT_PATH = "/home", BOARDS_PATH = "boards", + PROJECT_LIST_PATH = "projects", + PROJECT_LIST_DIRECT_PATH = "/projects", + UNKNOWN_PATH = "**" } diff --git a/corn-frontend/src/app/pages/home/home.component.ts b/corn-frontend/src/app/pages/home/home.component.ts index 84e12bd8..45305e81 100644 --- a/corn-frontend/src/app/pages/home/home.component.ts +++ b/corn-frontend/src/app/pages/home/home.component.ts @@ -8,6 +8,7 @@ import { Feature } from "@core/interfaces/home/feature.interface"; import { KeycloakService } from 'keycloak-angular'; import { CommonModule, NgOptimizedImage } from '@angular/common'; import { Router } from '@angular/router'; +import { RouterPaths } from "@core/enum/RouterPaths"; @Component({ selector: 'app-home', @@ -35,8 +36,7 @@ export class HomeComponent implements OnInit { ngOnInit() { if (this.keycloak.isLoggedIn()) { - //TODO implement proper auth guard - this.router.navigate(['/projects']); + this.router.navigate([`${RouterPaths.PROJECT_LIST_DIRECT_PATH}`]); } }