Pending course, rest ready for launch
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import { createClient, type SupabaseClient } from "@supabase/supabase-js";
|
||||
import { createBrowserClient } from "@supabase/ssr";
|
||||
import type { SupabaseClient } from "@supabase/supabase-js";
|
||||
import { readSupabasePublicConfig } from "@/lib/supabase/config";
|
||||
|
||||
let browserClient: SupabaseClient | null = null;
|
||||
|
||||
/**
|
||||
* Browser Supabase client that uses cookies (via @supabase/ssr) so the session
|
||||
* is shared with the server/middleware and stays in sync after login.
|
||||
*/
|
||||
export const supabaseBrowser = (): SupabaseClient | null => {
|
||||
const config = readSupabasePublicConfig();
|
||||
if (!config) {
|
||||
@@ -10,7 +15,7 @@ export const supabaseBrowser = (): SupabaseClient | null => {
|
||||
}
|
||||
|
||||
if (!browserClient) {
|
||||
browserClient = createClient(config.url, config.anonKey);
|
||||
browserClient = createBrowserClient(config.url, config.anonKey);
|
||||
}
|
||||
|
||||
return browserClient;
|
||||
|
||||
Reference in New Issue
Block a user