e183b386a1
The login form's hx-on::after-request redirected to /admin/ on any 2xx response. The TOTP-required path also returns 2xx — with an HTML fragment that unhides the TFA section — so the redirect fired before the user ever saw the code input, locking out anyone who had enrolled TOTP. Only redirect when the 2xx body is empty (the real-login signal). When the body is non-empty it's the prompt fragment, which htmx swaps into #err and whose inline <script> reveals #tfa-section. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>