This commit is contained in:
hailin 2025-05-21 01:49:15 +08:00
parent 08c7d3fc13
commit e923336adc
1 changed files with 16 additions and 1 deletions

View File

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