fix: reject unconfirmed Telegram tests and invalid update responses
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ export async function kodIleBagla(kod, {issuedAt,expiresAt,now=Date.now()} = {})
|
||||
if(!/^[a-f0-9]{48}$/.test(String(kod))||!Number.isFinite(issuedAt)||!Number.isFinite(expiresAt)||now>=expiresAt)return null;
|
||||
const r = await fetch(`${API()}/getUpdates?limit=100`, { signal: AbortSignal.timeout(15000) });
|
||||
const d = await r.json().catch(() => ({}));
|
||||
if (!d.ok) throw new Error(d.description || 'getUpdates başarısız');
|
||||
if (!r.ok || d.ok!==true || !Array.isArray(d.result)) throw new Error(d.description || 'Telegram güncelleme yanıtı doğrulanamadı. Yeniden deneyin.');
|
||||
const aranan = String(kod);
|
||||
for (const u of [...(d.result || [])].reverse()) {
|
||||
const m = u.message;
|
||||
|
||||
Reference in New Issue
Block a user