From 29e905271df3f1a47a1044afa9e78c5c20d72dad Mon Sep 17 00:00:00 2001 From: "hao.cheng" Date: Fri, 25 Oct 2019 15:36:07 +0800 Subject: [PATCH] promote code quality Signed-off-by: hao.cheng --- src/common/dao/user.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 }