fix(auth): change .single() to .maybeSingle() for profile fetches to prevent 406 errors

This commit is contained in:
2026-08-19 16:48:15 +00:00
parent 33e95f125b
commit 1fa393c157
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -50,13 +50,13 @@ export function UserInfo() {
.from('profiles')
.select('full_name, email, profile_image_url')
.eq('id', user.id)
.single();
.maybeSingle();
if (!error && data) {
setProfile(data);
} else {
setProfile({
full_name: user.user_metadata?.full_name || null,
full_name: (user as any).name || (user as any).username || null,
email: user.email || null,
profile_image_url: null
});