fix: onboarding infinite spinner

This commit is contained in:
Rotimi Best
2023-11-23 22:18:31 +00:00
parent b20a108c1d
commit 57ad7224e6
8 changed files with 24 additions and 20 deletions
+7 -1
View File
@@ -77,7 +77,7 @@
data: { session }
} = await supabase.auth.getSession();
const { user: authUser } = session || {};
console.log('Get user profile', authUser);
console.log('Get user', authUser);
if (!authUser) {
goto('/login?redirect=/' + path);
@@ -89,6 +89,8 @@
error,
status
} = await supabase.from('profile').select(`*`).eq('id', authUser?.id).single();
console.log('Get user', authUser);
console.log('Get profile', profileData);
if (error && !profileData && status === 406 && authUser) {
// User wasn't found, create profile
@@ -182,6 +184,10 @@
setTheme(orgRes.currentOrg.theme);
}
}
if (!profileData) {
goto('/login?redirect=/' + path);
}
}
function handleResize() {