fix(kattis): harden reactive re-auth trigger on submit

Problem: stale cookie detection only matched the exact text
`"Request validation failed"`, missing cases where Kattis returns
a 400 or 403 status instead.

Solution: also trigger re-login when `r.status_code in (400, 403)`.
This commit is contained in:
Barrett Ruth 2026-03-07 02:15:42 -05:00
parent 397576ad93
commit 923dc7293f
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -366,7 +366,7 @@ class KattisScraper(BaseScraper):
except Exception as e:
return self._submit_error(f"Submit request failed: {e}")
if r.text == "Request validation failed":
if r.status_code in (400, 403) or r.text == "Request validation failed":
_COOKIE_PATH.unlink(missing_ok=True)
print(json.dumps({"status": "logging_in"}), flush=True)
ok = await _do_kattis_login(client, username, password)