From a57f0588e9b1d8baf8bb5c919857049f9677c8f6 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 4 Oct 2025 21:42:08 +0000 Subject: [PATCH] Remove fallback logic from createInitialProfile cgen-87e6756b089349838086237c1ae708b2 --- client/lib/aethex-database-adapter.ts | 50 ++------------------------- 1 file changed, 2 insertions(+), 48 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 5668d5ec..a26ee521 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -375,58 +375,12 @@ export const aethexUserService = { profileData: Partial, email?: string | null, ): Promise { + ensureSupabase(); + const now = new Date(); const nowIso = now.toISOString(); const todayIso = isoDate(startOfUTC(now)); - if (!isSupabaseConfigured) { - const stored = await mockAuth.updateProfile( - userId, - { - id: userId, - username: - profileData.username || - (email ? email.split("@")[0] : undefined) || - `user_${Date.now()}`, - user_type: (profileData as any).user_type || "game_developer", - experience_level: (profileData as any).experience_level || "beginner", - full_name: profileData.full_name, - bio: profileData.bio, - location: profileData.location, - website_url: (profileData as any).website_url, - github_url: profileData.github_url, - twitter_url: profileData.twitter_url, - linkedin_url: profileData.linkedin_url, - banner_url: (profileData as any).banner_url, - level: 1, - total_xp: 0, - current_streak: 1, - longest_streak: 1, - last_streak_at: todayIso, - created_at: nowIso, - updated_at: nowIso, - onboarded: true, - } as any, - ); - - return normalizeProfile( - { - ...stored, - user_type: - (stored as any)?.user_type ?? (profileData as any).user_type ?? "game_developer", - experience_level: - (stored as any)?.experience_level ?? - (profileData as any).experience_level ?? - "beginner", - total_xp: (stored as any)?.total_xp ?? 0, - level: (stored as any)?.level ?? 1, - }, - stored.email ?? email ?? null, - ); - } - - ensureSupabase(); - const { data, error } = await supabase .from("user_profiles") .insert({