Skip to content

Commit

Permalink
Trim username and password form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Sep 9, 2023
1 parent fbce915 commit 939a91e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/ui/form/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package form // import "miniflux.app/v2/internal/ui/form"

import (
"net/http"
"strings"

"miniflux.app/v2/internal/errors"
)
Expand All @@ -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")),
}
}

0 comments on commit 939a91e

Please sign in to comment.