fix: treat 200 login API response as provisional success
This commit is contained in:
@@ -160,11 +160,14 @@ class AutoLoginManager:
|
||||
except Exception:
|
||||
payload = None
|
||||
|
||||
api_ok = bool(
|
||||
login_resp.status == 200
|
||||
and isinstance(payload, dict)
|
||||
and payload.get("need_login") is False
|
||||
)
|
||||
api_ok = False
|
||||
if login_resp.status == 200:
|
||||
# Some environments return non-JSON/empty body for ajax login;
|
||||
# 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:
|
||||
debug_file = await self._dump_debug_page(page)
|
||||
raise RuntimeError(
|
||||
|
||||
Reference in New Issue
Block a user