Improve other auth methods in proxy

cgen-322a0a56df934064950e20a7a07ef977
This commit is contained in:
Builder.io 2025-08-17 00:15:26 +00:00
parent 3d50af82cd
commit 01bec84abb

View file

@ -70,7 +70,7 @@ export const supabase = new Proxy(supabaseClient || {}, {
}
},
signOut: async () => {
if (isSupabaseConfigured && target.auth) {
if (isSupabaseConfigured && target && target.auth) {
try {
return await target.auth.signOut();
} catch (error) {
@ -80,7 +80,7 @@ export const supabase = new Proxy(supabaseClient || {}, {
return await mockAuth.signOut();
},
getUser: async () => {
if (isSupabaseConfigured && target.auth) {
if (isSupabaseConfigured && target && target.auth) {
try {
return await target.auth.getUser();
} catch (error) {
@ -90,7 +90,7 @@ export const supabase = new Proxy(supabaseClient || {}, {
return await mockAuth.getUser();
},
getSession: async () => {
if (isSupabaseConfigured && target.auth) {
if (isSupabaseConfigured && target && target.auth) {
try {
return await target.auth.getSession();
} catch (error) {