module ClientAuthenticator::ApiAuthenticable
Public Instance Methods
authenticate_client!()
click to toggle source
# File lib/client_authenticator/api_authenticable.rb, line 7 def authenticate_client! client_id = request.headers[ClientAuthenticator.configuration.client_id_header] pass_key = request.headers[ClientAuthenticator.configuration.pass_key_header] if client_id.nil? || pass_key.nil? || unauthorized?(client_id, pass_key) render json: {'error' => 'unauthorized'}, status: :unauthorized end end