mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix(auth): различать устаревшего бота и ненастроенного на экране логина
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import apiClient from './client';
|
||||
import { isEndpointMissingError } from '../utils/api-error';
|
||||
import type { AnimationConfig } from '@/components/ui/backgrounds/types';
|
||||
import { DEFAULT_ANIMATION_CONFIG } from '@/components/ui/backgrounds/types';
|
||||
|
||||
@@ -36,6 +37,8 @@ export interface TelegramWidgetConfig {
|
||||
request_access: boolean;
|
||||
oidc_enabled: boolean;
|
||||
oidc_client_id: string;
|
||||
/** The bot answered 404 on the config route — build older than v3.24.0. */
|
||||
endpoint_missing?: boolean;
|
||||
}
|
||||
|
||||
export interface OfflineConvGoal {
|
||||
@@ -321,7 +324,7 @@ export const brandingApi = {
|
||||
'/cabinet/branding/telegram-widget',
|
||||
);
|
||||
return response.data;
|
||||
} catch {
|
||||
} catch (err) {
|
||||
return {
|
||||
bot_username: import.meta.env.VITE_TELEGRAM_BOT_USERNAME || '',
|
||||
size: 'large',
|
||||
@@ -330,6 +333,7 @@ export const brandingApi = {
|
||||
request_access: true,
|
||||
oidc_enabled: false,
|
||||
oidc_client_id: '',
|
||||
endpoint_missing: isEndpointMissingError(err),
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user