From 7fce831c75eb372e7cdbc07b3e2b029acd272db1 Mon Sep 17 00:00:00 2001 From: ALAMI Adnane Date: Wed, 23 Apr 2025 10:05:27 +0200 Subject: [PATCH] feat: rooting corrected --- front/MyINPulse-front/src/components/LoginComponent.vue | 2 +- front/MyINPulse-front/src/router/router.ts | 4 ++-- front/MyINPulse-front/src/stores/authStore.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/front/MyINPulse-front/src/components/LoginComponent.vue b/front/MyINPulse-front/src/components/LoginComponent.vue index 3706e60..317e1e9 100644 --- a/front/MyINPulse-front/src/components/LoginComponent.vue +++ b/front/MyINPulse-front/src/components/LoginComponent.vue @@ -22,7 +22,7 @@ onMounted(() => { const roles = decoded.realm_access?.roles || []; if (roles.includes("MyINPulse-admin")) { - router.push("/"); + router.push("/admin"); } else if (roles.includes("MyINPulse-entrepreneur")) { router.push("/leanCanva"); } diff --git a/front/MyINPulse-front/src/router/router.ts b/front/MyINPulse-front/src/router/router.ts index 7b7c4ef..860873b 100644 --- a/front/MyINPulse-front/src/router/router.ts +++ b/front/MyINPulse-front/src/router/router.ts @@ -12,12 +12,12 @@ const router = createRouter({ component: () => import("../views/testComponent.vue"), }, { - path: "/login", + path: "/", name: "login", component: () => import("../components/LoginComponent.vue"), }, { - path: "/", + path: "/admin", name: "Admin-main", component: () => import("../views/AdminMain.vue"), }, diff --git a/front/MyINPulse-front/src/stores/authStore.ts b/front/MyINPulse-front/src/stores/authStore.ts index a5874d4..6685a0b 100644 --- a/front/MyINPulse-front/src/stores/authStore.ts +++ b/front/MyINPulse-front/src/stores/authStore.ts @@ -54,7 +54,7 @@ const useAuthStore = defineStore("storeAuth", { async logout() { try { await keycloakService.CallLogout( - import.meta.env.VITE_APP_URL + "/login" //redirect to login page instead of test... + import.meta.env.VITE_APP_URL + "/" //redirect to login page instead of test... ); await this.clearUserData(); } catch (error) {