From fce16b53f71412833ff8756e1d7b53751d8dd59f Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 16 Feb 2026 21:08:15 -0500 Subject: [PATCH] fix(auth): return JSON for HTMX login failures instead of HTML --- internal/handlers/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/handlers/auth.go b/internal/handlers/auth.go index 6d1f731..1f7bc92 100644 --- a/internal/handlers/auth.go +++ b/internal/handlers/auth.go @@ -332,7 +332,7 @@ func (h *AuthHandler) Login(c echo.Context) error { } if c.Request().Header.Get("HX-Request") == "true" { - return c.HTML(http.StatusUnauthorized, `
Invalid credentials
`) + return c.JSON(http.StatusUnauthorized, map[string]string{"error": "invalid credentials"}) } return c.JSON(http.StatusUnauthorized, map[string]string{"error": "invalid credentials"}) } @@ -348,7 +348,7 @@ func (h *AuthHandler) Login(c echo.Context) error { } if c.Request().Header.Get("HX-Request") == "true" { - return c.HTML(http.StatusUnauthorized, `
Invalid credentials
`) + return c.JSON(http.StatusUnauthorized, map[string]string{"error": "invalid credentials"}) } return c.JSON(http.StatusUnauthorized, map[string]string{"error": "invalid credentials"}) }