diff --git a/package.json b/package.json index 1530ea1..2eb6b48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pezkuwi-telegram-miniapp", - "version": "1.0.121", + "version": "1.0.122", "type": "module", "description": "Pezkuwichain Telegram Mini App - Forum, Announcements, Rewards", "author": "Pezkuwichain Team", diff --git a/src/lib/supabase.ts b/src/lib/supabase.ts index 5896506..e1a0ec7 100644 --- a/src/lib/supabase.ts +++ b/src/lib/supabase.ts @@ -16,8 +16,32 @@ export async function signInWithTelegram(initData: string) { }); if (error) { - console.error('[Auth] Telegram sign-in failed:', error); - throw error; + // Extract more detailed error message + let errorMessage = error.message || 'Unknown error'; + + // Check if there's additional context in the error + if (error.context?.body) { + try { + const bodyError = JSON.parse(error.context.body); + if (bodyError.error) { + errorMessage = bodyError.error; + } + } catch { + // Body is not JSON, use as-is + if (typeof error.context.body === 'string') { + errorMessage = error.context.body; + } + } + } + + console.error('[Auth] Telegram sign-in failed:', errorMessage); + throw new Error(errorMessage); + } + + // Check if edge function returned an error in data + if (data?.error) { + console.error('[Auth] Edge function error:', data.error); + throw new Error(data.error); } if (data?.session) { diff --git a/src/version.json b/src/version.json index 2fc8714..1c233fb 100644 --- a/src/version.json +++ b/src/version.json @@ -1,5 +1,5 @@ { - "version": "1.0.121", - "buildTime": "2026-02-06T16:48:42.195Z", - "buildNumber": 1770396522198 + "version": "1.0.122", + "buildTime": "2026-02-06T17:04:46.943Z", + "buildNumber": 1770397486943 }