From e22e74f6473200edacc8ec1ea4ba887e768c3b04 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 17 Aug 2025 00:18:17 +0000 Subject: [PATCH] Add global Supabase test function cgen-e4718614a9e8400c9c01122f80dbbdee --- client/lib/supabase.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/client/lib/supabase.ts b/client/lib/supabase.ts index 281f5e86..1324db76 100644 --- a/client/lib/supabase.ts +++ b/client/lib/supabase.ts @@ -150,3 +150,27 @@ export const storage = supabase.storage; // Real-time helpers export const channel = supabase.channel; + +// Test function for debugging +(window as any).testSupabase = async () => { + console.log("🧪 Manual Supabase Test"); + console.log("URL:", supabaseUrl); + console.log("Key configured:", !!supabaseAnonKey); + + try { + const testLogin = await supabase.auth.signInWithPassword({ + email: "test@example.com", + password: "test123" + }); + console.log("Auth test result:", testLogin); + } catch (error) { + console.error("Auth test error:", error); + } + + try { + const { data, error } = await supabase.from('user_profiles').select('*').limit(1); + console.log("Database test - data:", data, "error:", error); + } catch (dbError) { + console.error("Database test error:", dbError); + } +};