From 939a91e99db23dced173b6ac6374ea9a9ac79e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Fri, 8 Sep 2023 20:11:48 -0700 Subject: [PATCH] Trim username and password form fields --- internal/ui/form/auth.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/ui/form/auth.go b/internal/ui/form/auth.go index dbb4974b..37c3eab0 100644 --- a/internal/ui/form/auth.go +++ b/internal/ui/form/auth.go @@ -5,6 +5,7 @@ package form // import "miniflux.app/v2/internal/ui/form" import ( "net/http" + "strings" "miniflux.app/v2/internal/errors" ) @@ -27,7 +28,7 @@ func (a AuthForm) Validate() error { // NewAuthForm returns a new AuthForm. func NewAuthForm(r *http.Request) *AuthForm { return &AuthForm{ - Username: r.FormValue("username"), - Password: r.FormValue("password"), + Username: strings.TrimSpace(r.FormValue("username")), + Password: strings.TrimSpace(r.FormValue("password")), } }