Add global autofill guard for hub, env, and transfer inputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-20 10:18:56 +08:00
parent 00d76ba20f
commit 4a3e6a2a1d
15 changed files with 221 additions and 38 deletions
+11
View File
@@ -777,6 +777,17 @@ _ACCOUNT_RISK_BADGE_CSS = _REPO_STATIC / "account_risk_badge.css"
_ACCOUNT_RISK_BADGE_JS = _REPO_STATIC / "account_risk_badge.js"
_OPTIONS_EXPIRY_COUNTDOWN_JS = _REPO_STATIC / "options_expiry_countdown.js"
_OPTIONS_POSITION_CARDS_JS = _REPO_STATIC / "options_position_cards.js"
_AUTOFILL_GUARD_JS = _REPO_STATIC / "autofill_guard.js"
@app.get("/assets/autofill_guard.js")
def hub_autofill_guard_js():
if not _AUTOFILL_GUARD_JS.is_file():
raise HTTPException(status_code=404, detail="autofill_guard.js not found")
return FileResponse(
str(_AUTOFILL_GUARD_JS),
media_type="application/javascript; charset=utf-8",
)
@app.get("/assets/account_risk_badge.css")