Commit Graph

8 Commits

Author SHA1 Message Date
Fringg
45e68ffac2 fix: safe error handling and numeric client_id in OIDC login
- Replace unsafe `as` cast with runtime type guard
- Pass client_id as Number() per Telegram OIDC spec
- Update TypeScript type to string | number
2026-03-07 03:04:46 +03:00
Fringg
5c11f1251a fix: address code review findings for TelegramLoginButton
- Replace useCallback with ref pattern to prevent stale closures and
  unnecessary Telegram.Login.init() re-calls
- Make isOIDC a proper boolean with Boolean() wrapper
- Clear previous error on successful login attempt
- Remove hardcoded fallback string from t() call
2026-03-07 02:51:18 +03:00
Fringg
91f0e9e2fc 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
2026-03-07 02:37:12 +03:00
Fringg
2c65ca8a7f feat: migrate Telegram Login Widget to v23 with admin-configurable settings
- Upgrade telegram-widget.js from v22 to v23 (TelegramLoginButton + ConnectedAccounts)
- TelegramLoginButton fetches widget config from API instead of hardcoded values
- Add TelegramWidgetConfig type and API method with fallback to env defaults
- Remove botUsername prop — now sourced from backend API
- Add useEffect cleanup to prevent orphaned iframes on unmount
- Add TELEGRAM_WIDGET category to admin interface settings menu
- Add i18n translations for widget settings (ru, en, zh, fa)
2026-03-07 01:48:18 +03:00
Fringg
2b2ead837c feat: add referral code persistence across all auth methods
Mirrors campaign.ts localStorage pattern to capture ?ref= from URL and pass
referral_code to backend during Telegram Widget, OAuth, email login, and
Mini App authentication. Fixes redirect loop when email auth is disabled.
2026-02-18 23:59:32 +03:00
c0mrade
bc90ba3779 refactor: migrate to eslint flat config and format codebase with prettier
- Remove legacy .eslintrc.cjs and .eslintignore
- Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url)
- Add .prettierrc and .prettierignore
- Format entire codebase with prettier
2026-01-27 17:37:31 +03:00
Egor
84e351ceb4 Update TelegramLoginButton.tsx 2026-01-18 06:49:36 +03:00
Egor
7be6b5c0ae Add files via upload 2026-01-15 19:18:17 +03:00