API login/logout with http header token

This commit is contained in:
Min Zeya Phyo
2017-04-15 12:52:40 +06:30
parent 5ca9615e38
commit 355f4fadb0
11 changed files with 67 additions and 86 deletions

View File

@@ -16,8 +16,11 @@ module TokenVerification
def authenticate_token
authenticate_with_http_token do |token, options|
#@current_user = User.find_by(api_key: token)
@user = Employee.authenticate_token(token)
Rails.logger.debug "token - " + token.to_s
@user = Employee.authenticate_by_token(token)
if @user
return true
#Maybe log - login?
end