diff options
author | zeripath <art27@cantab.net> | 2020-01-11 11:14:03 +0000 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2020-01-11 13:14:03 +0200 |
commit | 0e5126da22a150aaf27ed17ce34aa84ffcd27f9e (patch) | |
tree | 2b4ccfc4f4ca8a1a08b13b6ea2e670915e8e0905 | |
parent | cd3e52d91b1b6a7f75123c4106759989c9128b0a (diff) | |
download | gitea-0e5126da22a150aaf27ed17ce34aa84ffcd27f9e.tar.gz gitea-0e5126da22a150aaf27ed17ce34aa84ffcd27f9e.zip |
Never allow an empty password to validate (#9682) (#9684)
* Restore IsPasswordSet previous value
* Update models/user.go
-rw-r--r-- | models/user.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go index 5efa31cf8b..1a466313c5 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. |