mirror of
https://github.com/go-gitea/gitea.git
synced 2025-04-20 03:12:12 +02:00
fix bug not to trim space of login username (#1806)
This commit is contained in:
parent
4fd55d8796
commit
bbe6aa349f
@ -635,7 +635,12 @@ func UserSignIn(username, password string) (*User, error) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
user = &User{LowerName: strings.ToLower(strings.TrimSpace(username))}
|
||||
trimmedUsername := strings.TrimSpace(username)
|
||||
if len(trimmedUsername) == 0 {
|
||||
return nil, ErrUserNotExist{0, username, 0}
|
||||
}
|
||||
|
||||
user = &User{LowerName: strings.ToLower(trimmedUsername)}
|
||||
}
|
||||
|
||||
hasUser, err := x.Get(user)
|
||||
|
Loading…
x
Reference in New Issue
Block a user