add verify_user function

This commit is contained in:
nigel007 2019-04-14 16:24:01 +08:00
parent a1d70dae18
commit c484f17812
1 changed files with 13 additions and 0 deletions

View File

@ -340,4 +340,17 @@ class UsersService
end
# add by zxh
# verifyUser by login and password
# if correct: return user object
# else: return nil
def verify_user login, password
user = User.find_by_login(login)
if user.check_password?(password)
return user
end
nil
end
# add by zxh end
end