Skip to content

Commit

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

* Update models/user.go

Co-authored-by: Lauris BH <lauris@nix.lv>
  • Loading branch information
zeripath and lafriks committed Jan 11, 2020
1 parent ff16099 commit 7eaba6b
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 @@ -503,7 +503,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 7eaba6b

Please sign in to comment.