summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-01-11 11:14:03 +0000
committerLauris BH <lauris@nix.lv>2020-01-11 13:14:03 +0200
commit0e5126da22a150aaf27ed17ce34aa84ffcd27f9e (patch)
tree2b4ccfc4f4ca8a1a08b13b6ea2e670915e8e0905
parentcd3e52d91b1b6a7f75123c4106759989c9128b0a (diff)
downloadgitea-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.go2
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.