From 7eaba6ba8ab2d525bf3e90678c7e17d23f695314 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 11 Jan 2020 14:27:03 +0000 Subject: [PATCH] Never allow an empty password to validate (#9682) (#9683) * Restore IsPasswordSet previous value * Update models/user.go Co-authored-by: Lauris BH --- models/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index f2c0a1861..9ddd262ae 100644 --- a/models/user.go +++ b/models/user.go @@ -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.