fix: enforce SUPABASE_URL and SUPABASE_SECRET_KEY presence in server-side client; remove unused supabase-server.ts file

This commit is contained in:
willchen96 2026-05-16 01:16:05 +08:00
parent aed8c42e94
commit 9749d601fa
3 changed files with 4 additions and 40 deletions

View file

@ -7,6 +7,9 @@ import { createClient } from "@supabase/supabase-js";
export function createServerSupabase() {
const url = process.env.SUPABASE_URL || "";
const key = process.env.SUPABASE_SECRET_KEY || "";
if (!url || !key) {
throw new Error("SUPABASE_URL and SUPABASE_SECRET_KEY must be set");
}
return createClient(url, key, { auth: { persistSession: false } });
}