{"record":{"id":"40c04512be8d368b","repo":"usestrix/strix","slug":"reverify","errorCode":"reverify","errorMessage":"reverify","messagePattern":"reverify","errorType":"error_code","errorClass":"RelayError","httpStatus":401,"severity":"error","filePath":"strix/interface/viewer/auth.py","lineNumber":243,"sourceCode":"    target: str,\n) -> None:\n    \"\"\"Forward the encrypted PDF to the relay for delivery.\n\n    The report password is NEVER part of this payload; only the encrypted PDF\n    bytes travel to the relay.\n    \"\"\"\n    payload = {\n        \"token\": token,\n        \"pdf_base64\": base64.b64encode(pdf_bytes).decode(\"ascii\"),\n        \"filename\": filename,\n        \"run_name\": run_name,\n        \"target\": target,\n    }\n    status, _ = _post_json(\"/api/oss/report/send\", payload, timeout=_SEND_TIMEOUT)\n    if status == 200:\n        return\n    if status == 401:\n        raise RelayError(\"reverify\")\n    if status == 413:\n        raise RelayError(\"too_large\")\n    if status == 403:\n        raise RelayError(\"forbidden\")\n    raise RelayError(\"unavailable\")\n\n\n__all__ = [\n    \"AUTH_PATH\",\n    \"RelayError\",\n    \"feedback_submit\",\n    \"forget\",\n    \"is_verified\",\n    \"otp_start\",\n    \"otp_verify\",\n    \"read_auth\",\n    \"report_send\",\n    \"write_auth\",","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/usestrix/strix/blob/85513391305171ecc6faffe03da4a8bda5e3febb/strix/interface/viewer/auth.py#L225-L261","documentation":"RelayError('reverify') raised by report_send() when POST /api/oss/report/send returns 401 — the verification token is missing, expired, or no longer accepted. Report delivery requires an active OTP verification; when the token has lapsed the caller must re-run the otp_start/otp_verify flow before retrying the send.","triggerScenarios":"Calling report_send(token, pdf, ...) with a token past its expires_at, one loaded from a stale on-disk auth file, or after the relay invalidated old tokens. The 401 maps to 'reverify' signalling the re-verification path specifically.","commonSituations":"User verified hours/days earlier and returns to send a report (token TTL elapsed); clock skew between client and relay expiring the token early; shared machine where another session overwrote the auth file; long report generation delay pushing send past expiry.","solutions":["Re-run verification before retrying: otp_start(email), then otp_verify(email, code), then report_send again","Check is_verified() / token expiry before sending and proactively re-verify if close to expiry","Regenerate the report if the run data changed in the meantime, then send under the fresh token","Ensure system clock is correct (NTP) so tokens are not prematurely expired by skew"],"exampleFix":"# before\nreport_send(token, pdf, name, run, target)  # stale token -> reverify\n# after\nfrom strix.interface.viewer.auth import is_verified, otp_start, otp_verify\nif not is_verified():\n    otp_start(email); otp_verify(email, prompt_code())\nreport_send(fresh_token(), pdf, name, run, target)","handlingStrategy":"try-catch","validationCode":"from strix.interface.viewer.auth import is_verified, read_auth, otp_start\nimport time\n\ndef needs_reverify() -> bool:\n    auth = read_auth()\n    return not is_verified() or auth is None","typeGuard":null,"tryCatchPattern":"try:\n    report_send(token, pdf, filename, run, target)\nexcept RelayError as e:\n    if e.code == \"reverify\":\n        otp_start(email)\n        otp_verify(email, prompt(\"code: \"))\n        report_send(fresh_token(), pdf, filename, run, target)\n    else:\n        raise","preventionTips":["Check is_verified() before enabling the 'send report' action","Re-verify proactively when the token nears expiry","Keep system clocks NTP-synced to avoid premature expiry"],"tags":["strix","relay","viewer","auth","report-delivery"],"backgroundTag":null,"analyzedSha":"85513391305171ecc6faffe03da4a8bda5e3febb","analyzedAt":"2026-08-15T05:03:57.275Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}