Fix onAuthStateChange in proxy

cgen-10faf35cf70944daacd95863cd6801f3
This commit is contained in:
Builder.io 2025-08-17 00:15:34 +00:00
parent 01bec84abb
commit d524f128f1

View file

@ -100,7 +100,7 @@ export const supabase = new Proxy(supabaseClient || {}, {
return await mockAuth.getSession();
},
onAuthStateChange: (callback: any) => {
if (isSupabaseConfigured && target.auth) {
if (isSupabaseConfigured && target && target.auth) {
try {
return target.auth.onAuthStateChange(callback);
} catch (error) {