Skip to content

Commit 0e5126d

Browse files
zeripathlafriks
authored andcommitted
Never allow an empty password to validate (#9682) (#9684)
* Restore IsPasswordSet previous value * Update models/user.go
1 parent cd3e52d commit 0e5126d

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
@@ -502,7 +502,7 @@ func (u *User) ValidatePassword(passwd string) bool {
502502

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

508508
// UploadAvatar saves custom avatar for user.

0 commit comments

Comments
 (0)