diff options
author | 2023-09-08 20:11:48 -0700 | |
---|---|---|
committer | 2023-09-08 20:50:08 -0700 | |
commit | 939a91e99db23dced173b6ac6374ea9a9ac79e94 (patch) | |
tree | 952c76605ea6f56d3b8b2f3d00b7199b539f0838 | |
parent | fbce915d8487708ba5e65208c4db700077abc8c1 (diff) | |
download | v2-939a91e99db23dced173b6ac6374ea9a9ac79e94.tar.gz v2-939a91e99db23dced173b6ac6374ea9a9ac79e94.tar.zst v2-939a91e99db23dced173b6ac6374ea9a9ac79e94.zip |
Trim username and password form fields
-rw-r--r-- | internal/ui/form/auth.go | 5 |
1 files 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")), } } |