Merge pull request #9593 from qyqcswill/code_improve

promote code quality
This commit is contained in:
Daniel Jiang 2019-11-08 18:28:46 +08:00 committed by GitHub
commit 7d04eab63c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -290,8 +290,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
}