From 51448af9f5be60a5b8c84c5f2a3b8c5640f1e404 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 8 Aug 2024 10:08:55 +0700 Subject: [PATCH 1/2] test close redirect --- src/plugins/keycloak.ts | 2 +- src/router/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/keycloak.ts b/src/plugins/keycloak.ts index b1ac26ca0..cc18fb645 100644 --- a/src/plugins/keycloak.ts +++ b/src/plugins/keycloak.ts @@ -24,7 +24,7 @@ async function kcLogout() { if (keycloak.authenticated !== undefined) { keycloak.logout(); } - window.location.href = "/login"; + // window.location.href = "/login"; } async function getToken() { diff --git a/src/router/index.ts b/src/router/index.ts index 89c3e3137..95f7a0c0b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -112,7 +112,7 @@ const router = createRouter({ router.beforeEach((to, from, next) => { if (to.meta.Auth) { if (keycloak.authenticated === undefined) { - kcLogout(); + // kcLogout(); } else { next(); } From b55b88b72ec149ce00aba1de4d06551f679a6aa6 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 8 Aug 2024 10:28:20 +0700 Subject: [PATCH 2/2] fixing --- src/plugins/http.ts | 2 +- src/plugins/keycloak.ts | 2 +- src/router/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/http.ts b/src/plugins/http.ts index db31987f9..1e65294ee 100644 --- a/src/plugins/http.ts +++ b/src/plugins/http.ts @@ -33,7 +33,7 @@ http.interceptors.response.use( // eslint-disable-next-line no-prototype-builtins if (error.hasOwnProperty("response")) { if (error.response.status === 401 || error.response.status === 403) { - // kcLogout(); + kcLogout(); // Store.commit("SET_ERROR_MESSAGE", error.response.data.message); // Store.commit("REMOVE_ACCESS_TOKEN") } diff --git a/src/plugins/keycloak.ts b/src/plugins/keycloak.ts index cc18fb645..b1ac26ca0 100644 --- a/src/plugins/keycloak.ts +++ b/src/plugins/keycloak.ts @@ -24,7 +24,7 @@ async function kcLogout() { if (keycloak.authenticated !== undefined) { keycloak.logout(); } - // window.location.href = "/login"; + window.location.href = "/login"; } async function getToken() { diff --git a/src/router/index.ts b/src/router/index.ts index 95f7a0c0b..89c3e3137 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -112,7 +112,7 @@ const router = createRouter({ router.beforeEach((to, from, next) => { if (to.meta.Auth) { if (keycloak.authenticated === undefined) { - // kcLogout(); + kcLogout(); } else { next(); }