This commit is contained in:
parent
49a5f0f1dd
commit
cf6b20f4a5
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue