(e: HTMLDivElement, message: string)
| 2449 | } |
| 2450 | return; |
| 2451 | } |
| 2452 | }; |
| 2453 | const doFetch = async () => { |
| 2454 | fetch(this.fetchURL, { |
| 2455 | method: this.method, |
| 2456 | body: JSON.stringify(build), |
| 2457 | headers: this.headers, |
| 2458 | }) |
| 2459 | .then(async (_) => { |
| 2460 | return [await _.text(), _.status] as const; |
| 2461 | }) |
| 2462 | .then(([_, status]) => { |
| 2463 | if (_ === "") return [null, status]; |
| 2464 | return [JSON.parse(_), status] as const; |
| 2465 | }) |
| 2466 | .then(async ([json, status]) => { |
| 2467 | if (await handleCaptcha(json, build, this.captcha)) { |
| 2468 | return await doFetch(); |
| 2469 | } |
| 2470 | const match = this.fetchURL.match(/https?:\/\/[^\/]*\/api/gm); |
| 2471 | if (match && this.tfaCheck) { |
| 2472 | const tried = await handle2fa(json, match[0]); |
no test coverage detected