mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
feat: TelegramLoginButton with OIDC popup + legacy widget fallback
- Add oidc_enabled/oidc_client_id to TelegramWidgetConfig interface and fallback - Add loginTelegramOIDC API method for id_token auth - Add loginWithTelegramOIDC to auth store - Rewrite TelegramLoginButton: OIDC popup when enabled, legacy widget otherwise - Extend Window.Telegram type with Login SDK in vite-env.d.ts
This commit is contained in:
15
src/vite-env.d.ts
vendored
15
src/vite-env.d.ts
vendored
@@ -19,8 +19,23 @@ interface TelegramWebAppGlobal {
|
||||
offEvent?: (event: string, callback: () => void) => void;
|
||||
}
|
||||
|
||||
/** Telegram Login JS SDK — loaded from https://oauth.telegram.org/js/telegram-login.js */
|
||||
interface TelegramLoginGlobal {
|
||||
init: (
|
||||
options: {
|
||||
client_id: string;
|
||||
request_access?: string[];
|
||||
lang?: string;
|
||||
},
|
||||
callback: (data: { id_token?: string; user?: Record<string, unknown>; error?: string }) => void,
|
||||
) => void;
|
||||
open: () => void;
|
||||
auth: () => void;
|
||||
}
|
||||
|
||||
interface Window {
|
||||
Telegram?: {
|
||||
WebApp?: TelegramWebAppGlobal;
|
||||
Login?: TelegramLoginGlobal;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user