Commit f54b4df
fix: detect HTTP 403 Cloudflare challenge before JSON parse in login
A 403 from the SSO/mobile host is a Cloudflare bot challenge returning a
non-JSON HTML page, so r.json() threw before the CAPTCHA_REQUIRED check
could run — surfacing as a confusing "login failed (non-JSON): HTTP 403".
Detect 403 explicitly (same class as 429/CAPTCHA) and raise a clear
bot-challenge error that falls through to the next strategy.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7fee7ee commit f54b4df
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
401 | 407 | | |
402 | 408 | | |
403 | 409 | | |
| |||
731 | 737 | | |
732 | 738 | | |
733 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
734 | 746 | | |
735 | 747 | | |
736 | 748 | | |
| |||
0 commit comments