Sha256: 1696bcb07dd444a02a71407fc33ece4732fefbc53d9e0458354bdc844536a29c

Contents?: true

Size: 376 Bytes

Versions: 15

Compression:

Stored size: 376 Bytes

Contents

module Sis
  module Core
    class ApplicationController < ActionController::API
      before_action :authenticate_request
      attr_reader :current_user

      private

      def authenticate_request
        @current_user = AuthorizeRequest.user(request.headers)
        render json: { error: 'Not Authorized' }, status: 401 unless @current_user
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sis_core-1.0.20 app/controllers/sis/core/application_controller.rb
sis_core-1.0.19 app/controllers/sis/core/application_controller.rb
sis_core-1.0.18 app/controllers/sis/core/application_controller.rb
sis_core-1.0.17 app/controllers/sis/core/application_controller.rb
sis_core-1.0.16 app/controllers/sis/core/application_controller.rb
sis_core-1.0.15 app/controllers/sis/core/application_controller.rb
sis_core-1.0.14 app/controllers/sis/core/application_controller.rb
sis_core-1.0.13 app/controllers/sis/core/application_controller.rb
sis_core-1.0.12 app/controllers/sis/core/application_controller.rb
sis_core-1.0.11 app/controllers/sis/core/application_controller.rb
sis_core-1.0.10 app/controllers/sis/core/application_controller.rb
sis_core-1.0.9 app/controllers/sis/core/application_controller.rb
sis_core-1.0.8 app/controllers/sis/core/application_controller.rb
sis_core-1.0.7 app/controllers/sis/core/application_controller.rb
sis_core-1.0.6 app/controllers/sis/core/application_controller.rb