From 3065c3a0df59c420af94bec199757c5bfaae5f29 Mon Sep 17 00:00:00 2001 From: "web@ppanel" Date: Mon, 30 Dec 2024 22:53:06 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(layout):=20Remove=20unnecess?= =?UTF-8?q?ary=20cookie=20initialization=20in=20Logout=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/utils/common.ts | 1 - apps/user/utils/common.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/admin/utils/common.ts b/apps/admin/utils/common.ts index 793d7bb..1d99ab3 100644 --- a/apps/admin/utils/common.ts +++ b/apps/admin/utils/common.ts @@ -42,7 +42,6 @@ export function getRedirectUrl() { export function Logout() { if (!isBrowser()) return; - const cookies = new Cookies(null, { path: '/' }); cookies.remove('Authorization'); const pathname = location.pathname; if (!['', '/'].includes(pathname)) { diff --git a/apps/user/utils/common.ts b/apps/user/utils/common.ts index 80e268b..c008d0f 100644 --- a/apps/user/utils/common.ts +++ b/apps/user/utils/common.ts @@ -41,7 +41,7 @@ export function getRedirectUrl() { } export function Logout() { - const cookies = new Cookies(null, { path: '/' }); + if (!isBrowser()) return; cookies.remove('Authorization'); const pathname = location.pathname; if (!['', '/', '/auth', '/tos'].includes(pathname)) {