Skip to content

Commit 397f2cd

Browse files
committed
revert unnecessary change
1 parent 5603920 commit 397f2cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/user/user.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,12 @@ func (u *User) SetPassword(passwd string) (err error) {
381381

382382
// ValidatePassword checks if the given password matches the one belonging to the user.
383383
func (u *User) ValidatePassword(passwd string) bool {
384-
return u.IsPasswordSet() && hash.Parse(u.PasswdHashAlgo).VerifyPassword(passwd, u.Passwd, u.Salt)
384+
return hash.Parse(u.PasswdHashAlgo).VerifyPassword(passwd, u.Passwd, u.Salt)
385385
}
386386

387-
// IsPasswordSet checks if the user allows to use password and the password is set
387+
// IsPasswordSet checks if the password is set or left empty
388388
func (u *User) IsPasswordSet() bool {
389-
return u.IsIndividual() && u.Passwd != ""
389+
return u.Passwd != ""
390390
}
391391

392392
// IsOrganization returns true if user is actually an organization.

0 commit comments

Comments
 (0)