This commit is contained in:
Marcelo
2026-02-17 00:07:00 +00:00
parent b7a86a2d1c
commit be4ca2ed78
92 changed files with 6850 additions and 1188 deletions

9
lib/supabase/server.ts Normal file → Executable file
View File

@@ -1,17 +1,16 @@
import { cookies } from "next/headers";
import { createServerClient, type CookieOptions } from "@supabase/ssr";
import { readSupabasePublicConfig } from "@/lib/supabase/config";
export const supabaseServer = async () => {
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
const anonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
if (!url || !anonKey) {
const config = readSupabasePublicConfig();
if (!config) {
return null;
}
const cookieStore = await cookies();
return createServerClient(url, anonKey, {
return createServerClient(config.url, config.anonKey, {
cookies: {
getAll() {
return cookieStore.getAll();