module ModelTokenAuth::ControllersAuth
Public Instance Methods
authenticate!()
click to toggle source
# File lib/model_token_auth/controllers_auth.rb, line 3 def authenticate! token = request.headers['HTTP_AUTHORIZATION'] if token.present? token_ = AccessToken.find_by_token(parses_the_token(token)) if token_&.entity_type? authenticate_entity(token_) else head :unauthorized end else head :bad_request end end
Private Instance Methods
authenticate_entity(token)
click to toggle source