From 5b661f6d55a81de19a5b7a6a50936b312c8584d6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 23 Jun 2025 10:46:51 +0700 Subject: [PATCH] logoutSSO --- src/plugins/auth.ts | 6 ++++++ src/views/MainLayout.vue | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/auth.ts b/src/plugins/auth.ts index 438d4268d..46b4295f7 100644 --- a/src/plugins/auth.ts +++ b/src/plugins/auth.ts @@ -88,6 +88,11 @@ async function redirectToLandingPage() { window.location.href = key_C_Config.landing_PageUrl; } +async function logoutSSO() { + await deleteCookie(ACCESS_TOKEN); + window.location.href = key_C_Config.landing_PageUrl + `/logout`; +} + export { getToken, authenticated, @@ -96,4 +101,5 @@ export { tokenParsed, getCookie, redirectToLandingPage, + logoutSSO, }; diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 4e083d072..ca8ae7706 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -11,6 +11,7 @@ import { logout, getCookie, redirectToLandingPage, + logoutSSO, } from "@/plugins/auth"; import avatar from "@/assets/avatar_user.jpg"; @@ -414,7 +415,7 @@ const doLogout = () => { $q, async () => { await http.post(config.API.keycloakLogSSO, { text: "ออกจากระบบ" }); - await logout(); + await logoutSSO(); }, "ยืนยันการออกจากระบบ", "ต้องการออกจากระบบใช่หรือไม่?"