Add direct Supabase connection test
cgen-6956b0a4c52e4ea984b68a4102aff0b5
This commit is contained in:
parent
a8a0cf7d1a
commit
d393a34157
1 changed files with 16 additions and 2 deletions
|
|
@ -28,17 +28,31 @@ if (isSupabaseConfigured) {
|
||||||
// Test connection
|
// Test connection
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
try {
|
try {
|
||||||
const { error } = await supabaseClient.from('user_profiles').select('count', { count: 'exact', head: true });
|
console.log("🔍 Testing Supabase connection to:", supabaseUrl);
|
||||||
|
const { data, error } = await supabaseClient.from('user_profiles').select('count', { count: 'exact', head: true });
|
||||||
if (error) {
|
if (error) {
|
||||||
console.warn("⚠️ Supabase connection test failed:", error.message);
|
console.warn("⚠️ Supabase connection test failed:", error.message);
|
||||||
console.log("🔄 Falling back to mock authentication for development");
|
console.log("🔄 Falling back to mock authentication for development");
|
||||||
} else {
|
} else {
|
||||||
console.log("✅ Supabase connection successful");
|
console.log("✅ Supabase connection successful - found", data, "user profiles");
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.warn("⚠️ Supabase connection error:", err.message);
|
console.warn("⚠️ Supabase connection error:", err.message);
|
||||||
console.log("🔄 Using mock authentication for development");
|
console.log("🔄 Using mock authentication for development");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Also test auth endpoint specifically
|
||||||
|
try {
|
||||||
|
console.log("🔍 Testing Supabase auth endpoint...");
|
||||||
|
const { data, error } = await supabaseClient.auth.getSession();
|
||||||
|
if (error) {
|
||||||
|
console.warn("⚠️ Supabase auth test failed:", error.message);
|
||||||
|
} else {
|
||||||
|
console.log("✅ Supabase auth endpoint accessible");
|
||||||
|
}
|
||||||
|
} catch (authErr: any) {
|
||||||
|
console.warn("⚠️ Supabase auth endpoint error:", authErr.message);
|
||||||
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue