Skip to content

Commit 7eaba6b

Browse files
zeripathlafriks
andcommitted
Never allow an empty password to validate (#9682) (#9683)
* Restore IsPasswordSet previous value * Update models/user.go Co-authored-by: Lauris BH <[email protected]>
1 parent ff16099 commit 7eaba6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/user.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ func (u *User) ValidatePassword(passwd string) bool {
503503

504504
// IsPasswordSet checks if the password is set or left empty
505505
func (u *User) IsPasswordSet() bool {
506-
return len(u.Passwd) > 0
506+
return !u.ValidatePassword("")
507507
}
508508

509509
// UploadAvatar saves custom avatar for user.

0 commit comments

Comments
 (0)