From e923336adc6c4e2a539b1273b7d9f2d66cebd1aa Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 21 May 2025 01:49:15 +0800 Subject: [PATCH] . --- chatdesk-ui/app/[locale]/login/page.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/chatdesk-ui/app/[locale]/login/page.tsx b/chatdesk-ui/app/[locale]/login/page.tsx index 25efb4e..0b42bbf 100644 --- a/chatdesk-ui/app/[locale]/login/page.tsx +++ b/chatdesk-ui/app/[locale]/login/page.tsx @@ -58,7 +58,22 @@ export default async function Login({ .maybeSingle(); if (!homeWorkspace) { - await supabase.auth.signOut(); + + // 清除当前请求的所有 cookie + const cookieStore = cookies(); + const allCookies = cookieStore.getAll(); // 获取当前请求的所有 cookies + allCookies.forEach(({ name }) => { + cookieStore.set({ + name, + value: "", + path: "/", + maxAge: 0, + httpOnly: true, + secure: true, + sameSite: "lax", + }); + }); + return redirect(`/${localeString}/login?message=sessionExpired`); }