feat(slice-4): honest delivery failure — send-before-commit + 502 delivery_failed (INV-9; closes #7)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 23:35:01 -07:00
parent 1b8c60fcb5
commit 22d738fc74
6 changed files with 77 additions and 12 deletions
+5
View File
@@ -138,6 +138,11 @@ def create_app(database_url: str | None = None, static_dir: str | Path | None =
f"Please wait {exc.retry_after_s}s before requesting another code.",
retry_after_s=exc.retry_after_s,
)
except accounts.DeliveryFailed:
return _error(
502, "delivery_failed",
"We couldn't send the code — try again in a moment.",
)
return Response(status_code=204)
@app.post("/api/auth/verify")