Never allow an empty password to validate (#9682) (#9684)

* Restore IsPasswordSet previous value

* Update models/user.go
This commit is contained in:
zeripath 2020-01-11 11:14:03 +00:00 committed by Lauris BH
parent cd3e52d91b
commit 0e5126da22

View file

@ -502,7 +502,7 @@ func (u *User) ValidatePassword(passwd string) bool {
// IsPasswordSet checks if the password is set or left empty
func (u *User) IsPasswordSet() bool {
return len(u.Passwd) > 0
return !u.ValidatePassword("")
}
// UploadAvatar saves custom avatar for user.