completionId: cgen-091a453929d548bba3c92f9ee36d0628
cgen-091a453929d548bba3c92f9ee36d0628
This commit is contained in:
parent
3399b1bbd9
commit
965eaf9cbe
1 changed files with 13 additions and 2 deletions
|
|
@ -4,9 +4,20 @@ const SUPABASE_URL =
|
|||
process.env.SUPABASE_URL || process.env.VITE_SUPABASE_URL || "";
|
||||
const SUPABASE_SERVICE_ROLE = process.env.SUPABASE_SERVICE_ROLE || "";
|
||||
|
||||
console.log("[Supabase Init] SUPABASE_URL configured:", !!SUPABASE_URL);
|
||||
console.log("[Supabase Init] SUPABASE_SERVICE_ROLE configured:", !!SUPABASE_SERVICE_ROLE);
|
||||
|
||||
export function getAdminClient() {
|
||||
if (!SUPABASE_URL) throw new Error("SUPABASE_URL not set");
|
||||
if (!SUPABASE_SERVICE_ROLE) throw new Error("SUPABASE_SERVICE_ROLE not set");
|
||||
if (!SUPABASE_URL) {
|
||||
console.error("[Supabase] SUPABASE_URL not set");
|
||||
throw new Error("SUPABASE_URL not set");
|
||||
}
|
||||
if (!SUPABASE_SERVICE_ROLE) {
|
||||
console.error("[Supabase] SUPABASE_SERVICE_ROLE not set");
|
||||
throw new Error("SUPABASE_SERVICE_ROLE not set");
|
||||
}
|
||||
|
||||
console.log("[Supabase] Creating client with URL:", SUPABASE_URL.substring(0, 30) + "...");
|
||||
return createClient(SUPABASE_URL, SUPABASE_SERVICE_ROLE, {
|
||||
auth: { autoRefreshToken: false, persistSession: false },
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue