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:
@@ -49,6 +49,20 @@ export const authApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Telegram OIDC authentication (popup flow with id_token)
|
||||
loginTelegramOIDC: async (
|
||||
idToken: string,
|
||||
campaignSlug?: string | null,
|
||||
referralCode?: string | null,
|
||||
): Promise<AuthResponse> => {
|
||||
const response = await apiClient.post<AuthResponse>('/cabinet/auth/telegram/oidc', {
|
||||
id_token: idToken,
|
||||
campaign_slug: campaignSlug || undefined,
|
||||
referral_code: referralCode || undefined,
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Email login
|
||||
loginEmail: async (
|
||||
email: string,
|
||||
|
||||
Reference in New Issue
Block a user