Skip to content

Commit

Permalink
Never allow an empty password to validate (#9682) (#9684)
Browse files Browse the repository at this point in the history
* Restore IsPasswordSet previous value

* Update models/user.go
  • Loading branch information
zeripath authored and lafriks committed Jan 11, 2020
1 parent cd3e52d commit 0e5126d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0e5126d

Please sign in to comment.