diff --git a/src/common/dao/user.go b/src/common/dao/user.go index 0417b44ab..5e5b6e951 100644 --- a/src/common/dao/user.go +++ b/src/common/dao/user.go @@ -293,8 +293,5 @@ func CleanUser(id int64) error { // MatchPassword returns true is password matched func matchPassword(u *models.User, password string) bool { - if u.Password != utils.Encrypt(password, u.Salt, u.PasswordVersion) { - return false - } - return true + return utils.Encrypt(password, u.Salt, u.PasswordVersion) == u.Password }