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`); }