Hey there,
I've been pulling my hair out because I want our app to authenticate users when loaded as iframe from a different source. Cookies seem to have a permission problem when trying to set them from a diff. domain so I thought i'd use localstorage for storing sessions instead:
Here's how I init my client on my NextJS 16 app:
"use client";
import { createBrowserClient } from "@supabase/ssr";
import { Database } from "../types/supabase";
export function getSupabaseClient() {
return createBrowserClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL as string,
process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY as string,
{
auth: {
autoRefreshToken: true,
persistSession: true,
storage: typeof window !== "undefined" ? window.localStorage : undefined,
debug: true,
},
}
);
}
The issue is that no matter what I use in the custom storage, the session is still always stored in cookies.
What am I missing here?
Hey there,
I've been pulling my hair out because I want our app to authenticate users when loaded as iframe from a different source. Cookies seem to have a permission problem when trying to set them from a diff. domain so I thought i'd use localstorage for storing sessions instead:
Here's how I init my client on my NextJS 16 app:
The issue is that no matter what I use in the custom storage, the session is still always stored in cookies.
What am I missing here?