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
This commit is contained in:
Fringg
2026-03-07 03:04:46 +03:00
parent 5c11f1251a
commit 45e68ffac2
2 changed files with 8 additions and 4 deletions

2
src/vite-env.d.ts vendored
View File

@@ -23,7 +23,7 @@ interface TelegramWebAppGlobal {
interface TelegramLoginGlobal {
init: (
options: {
client_id: string;
client_id: string | number;
request_access?: string[];
lang?: string;
},