module RapidApi::Auth::Concerns::SessionsController

Public Instance Methods

authenticate() click to toggle source
# File lib/rapid_api/auth/concerns/sessions_controller.rb, line 13
def authenticate
  authenticated = _authenticate(permitted_auth_params)
  if authenticated.present?
    render json:   _authentication_response_json(authenticated),
           status: :ok
  else
    render json: { errors: ['Invalid credentials'] }, status: :unauthorized
  end
end

Protected Instance Methods

permitted_auth_params() click to toggle source
# File lib/rapid_api/auth/concerns/sessions_controller.rb, line 25
def permitted_auth_params
  params.permit(*self.class.auth_params)
end