fix: remaining HIGH audit findings - dead 2FA cleanup + <html lang> (LC-353, LC-354) #368
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lc-353-354-audit-high-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The two remaining HIGH findings from the UI audit.
just testandjust test-saasboth green.LC-353 - remove dead 2FA UI cruft
The 2FA UI has been unreachable since the LC-22 pure-RP Bunyip cutover retired local auth. The templates posted to
/login/2fa,/login/recovery,/register/2fa,/settings/2fa/setup(none registered), and the view structs +AppState::two_factor_availablewere used by zero handlers.Deleted:
templates/two_factor/(5 files),views/two_factor.rs(+ its mod line),locales/{en,es}/two-factor.ftl(35 keys each), and the deadtwo_factor_availablehelper. Thei18n_catalogcoverage gate stays green: en/es are removed in lockstep and no live template referenced the keys. CLAUDE.md already documents auth as SSO-only, so no doc change.LC-354 - <html lang> follows the request locale
base.htmlhardcoded<html lang="en">despite a shipped, reachableeslocale, so Spanish users got es content underlang="en"(WCAG 3.1.1 failure on every page). Addedi18n::current_lang_code(reads theCURRENT_LOCALEtask-local, falls back outside a request) + alangAskama filter, and render<html lang="{{ ""|lang }}">. Unit test covers the scoped-locale and fallback paths.Closes LC-353, LC-354.
The 2FA UI has been unreachable since the pure-RP Bunyip cutover retired local auth: templates/two_factor/* posted to /login/2fa, /login/recovery, /register/2fa, /settings/2fa/setup, none of which are registered, and views/two_factor.rs's structs plus AppState::two_factor_available were instantiated/called by zero handlers. Delete templates/two_factor/ (5 files), views/two_factor.rs (+ its mod line), the now-unreferenced server/locales/{en,es}/two-factor.ftl catalogs (35 keys each; the i18n_catalog coverage gate stays green since en/es are removed in lockstep and no live template references them), and the dead two_factor_available helper. CLAUDE.md already describes auth as SSO-only post-LC-22, so no doc change is needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>base.html hardcoded `<html lang="en">` even though a Spanish locale ships and is reachable via POST /settings/language, so es users got es content under lang="en" - a WCAG 3.1.1 failure on every page (screen readers mispronounce, translation tools mis-detect). Add i18n::current_lang_code (reads the CURRENT_LOCALE task-local, falls back to the default outside a request) and a `lang` Askama filter, and render `<html lang="{{ ""|lang }}">`. Unit test covers the scoped-locale and fallback paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>