mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
fix: resolve Telegram Mini App auth failures on all platforms
- Skip token refresh/Bearer header for auth endpoints in request interceptor - Wait for auth store initialization before attempting Telegram login - Clear stale session tokens when init data changes (WebView persistence) - Show backend error details instead of generic messages
This commit is contained in:
@@ -4,6 +4,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import {
|
||||
init,
|
||||
restoreInitData,
|
||||
retrieveRawInitData,
|
||||
mountMiniApp,
|
||||
miniAppReady,
|
||||
mountThemeParams,
|
||||
@@ -19,6 +20,7 @@ import {
|
||||
requestFullscreen,
|
||||
isFullscreen,
|
||||
} from '@telegram-apps/sdk-react';
|
||||
import { clearStaleSessionIfNeeded } from './utils/token';
|
||||
import { AppWithNavigator } from './AppWithNavigator';
|
||||
import { ErrorBoundary } from './components/ErrorBoundary';
|
||||
import { initLogoPreload } from './api/branding';
|
||||
@@ -37,6 +39,9 @@ if (!alreadyInitialized) {
|
||||
init();
|
||||
restoreInitData();
|
||||
|
||||
// Сбрасываем старые токены если init data изменился (новая сессия Telegram)
|
||||
clearStaleSessionIfNeeded(retrieveRawInitData() || null);
|
||||
|
||||
// Mount components — each in its own try/catch so one failure doesn't block others
|
||||
try {
|
||||
mountMiniApp();
|
||||
|
||||
Reference in New Issue
Block a user