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"}) }