From 0e5126da22a150aaf27ed17ce34aa84ffcd27f9e Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 11 Jan 2020 11:14:03 +0000 Subject: [PATCH] Never allow an empty password to validate (#9682) (#9684) * Restore IsPasswordSet previous value * Update models/user.go --- models/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index 5efa31cf8..1a466313c 100644 --- a/models/user.go +++ b/models/user.go @@ -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.