fix: treat 200 login API response as provisional success
Some checks failed
CI / lint-and-compile (push) Has been cancelled
CI / lint-and-compile (pull_request) Has been cancelled

This commit is contained in:
root
2026-04-17 15:43:57 +08:00
parent d12668201f
commit e41ee8bcc8

View File

@@ -160,11 +160,14 @@ class AutoLoginManager:
except Exception: except Exception:
payload = None payload = None
api_ok = bool( api_ok = False
login_resp.status == 200 if login_resp.status == 200:
and isinstance(payload, dict) # Some environments return non-JSON/empty body for ajax login;
and payload.get("need_login") is False # if status is 200, let auth-status polling decide final success.
) if payload is None:
api_ok = True
elif isinstance(payload, dict):
api_ok = payload.get("need_login") is False
if not api_ok: if not api_ok:
debug_file = await self._dump_debug_page(page) debug_file = await self._dump_debug_page(page)
raise RuntimeError( raise RuntimeError(