This commit is contained in:
hailin 2025-05-21 16:08:52 +08:00
parent 49a5f0f1dd
commit cf6b20f4a5
1 changed files with 9 additions and 15 deletions

View File

@ -31,18 +31,6 @@ export default async function Login({
const localeString = locale;
const { t, resources } = await initTranslations(localeString, ['translation']);
// const supabase = createServerClient<Database>(
// getRuntimeEnv("SUPABASE_URL") ?? "http://localhost:8000",
// process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
// {
// cookies: {
// get(name: string) {
// return cookieStore.get(name)?.value
// }
// }
// }
// )
const supabase = getSupabaseServerClient()
const session = (await supabase.auth.getSession()).data.session
@ -57,10 +45,16 @@ export default async function Login({
.eq("is_home", true)
.maybeSingle();
// Define the clearCookies function
const clearCookies = async () => {
await fetch("/api/clearCookies", {
method: "POST",
});
const storedUrl = localStorage.getItem("supabaseUrl");
if (storedUrl) {
await fetch(`${storedUrl}/api/clearcookies`, {
method: "POST",
});
} else {
console.error("Supabase URL is not stored in localStorage");
}
};
if (!homeWorkspace) {