From e183b386a163b4610cc7a18eeebba8c3c9c89c5f Mon Sep 17 00:00:00 2001 From: Mike Mueller Date: Fri, 1 May 2026 20:37:49 +0200 Subject: [PATCH] fix(admin): show TOTP prompt instead of redirecting on 2fa-required login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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