diff --git a/packages/common/components/src/ui/header/index.tsx b/packages/common/components/src/ui/header/index.tsx index 00f758d60..e2cd9a654 100644 --- a/packages/common/components/src/ui/header/index.tsx +++ b/packages/common/components/src/ui/header/index.tsx @@ -5,7 +5,7 @@ import { useQuery } from "@tanstack/react-query"; import { images } from "@common/assets"; import { getConfig } from "@common/config"; import { ENDPOINT } from "../../config"; -import { setCookie, getCookie } from "../../lib"; +import { setCookie, getCookie, removeCookie } from "../../lib"; import { getPopupInfo, getUserPopupList, @@ -70,6 +70,24 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) { method: "POST", }); if (!response.ok) throw new Error("Failed to logout"); + + // 쿠키 삭제 + if (appConfig.AUTH_USER_ID) { + removeCookie(appConfig.AUTH_USER_ID); + } + if (appConfig.REFRESH_TOKEN) { + removeCookie(appConfig.REFRESH_TOKEN); + } + if (appConfig.ACCESS_TOKEN) { + removeCookie(appConfig.ACCESS_TOKEN); + } + if (appConfig.CLAIM_NAME) { + removeCookie(appConfig.CLAIM_NAME); + } + + removeCookie("site-id-key"); + removeCookie("site-theme-key"); + window.location.href = "/auth/login"; } catch (error) { console.error(error);