promote code quality

Signed-off-by: hao.cheng <hao.cheng@daocloud.io>
This commit is contained in:
hao.cheng 2019-10-25 15:36:07 +08:00
parent 3810dcef0f
commit 29e905271d

View File

@ -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
}