logoutSSO

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-06-23 10:46:51 +07:00
parent e07055a642
commit 5b661f6d55
2 changed files with 8 additions and 1 deletions

View file

@ -88,6 +88,11 @@ async function redirectToLandingPage() {
window.location.href = key_C_Config.landing_PageUrl; 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 { export {
getToken, getToken,
authenticated, authenticated,
@ -96,4 +101,5 @@ export {
tokenParsed, tokenParsed,
getCookie, getCookie,
redirectToLandingPage, redirectToLandingPage,
logoutSSO,
}; };

View file

@ -11,6 +11,7 @@ import {
logout, logout,
getCookie, getCookie,
redirectToLandingPage, redirectToLandingPage,
logoutSSO,
} from "@/plugins/auth"; } from "@/plugins/auth";
import avatar from "@/assets/avatar_user.jpg"; import avatar from "@/assets/avatar_user.jpg";
@ -414,7 +415,7 @@ const doLogout = () => {
$q, $q,
async () => { async () => {
await http.post(config.API.keycloakLogSSO, { text: "ออกจากระบบ" }); await http.post(config.API.keycloakLogSSO, { text: "ออกจากระบบ" });
await logout(); await logoutSSO();
}, },
"ยืนยันการออกจากระบบ", "ยืนยันการออกจากระบบ",
"ต้องการออกจากระบบใช่หรือไม่?" "ต้องการออกจากระบบใช่หรือไม่?"