Trim username and password form fields
This commit is contained in:
parent
fbce915d84
commit
939a91e99d
1 changed files with 3 additions and 2 deletions
|
@ -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")),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue