Sha256: b60f8fd4318b6cd53d0d88226f0b75e8f2e32e404772ed3da2d0605c6db26e4c

Contents?: true

Size: 286 Bytes

Versions: 13

Compression:

Stored size: 286 Bytes

Contents

module SimpleAdmin
  class BaseController < ActionController::API
    before_action :verify_key_is_valid!

    private

      def verify_key_is_valid!
        return head(:forbidden) unless request.headers['SimpleAdmin-Secret-Key'] == ENV['SIMPLE_ADMIN_SECRET_KEY']
      end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
simpleadmin-1.2.7 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.2.6 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.2.5 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.2.4 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.2.3 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.2.2 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.2.1 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.2.0 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.1.0 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.0.3 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.0.2 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.0.1 app/controllers/simple_admin/base_controller.rb
simpleadmin-1.0.0 app/controllers/simple_admin/base_controller.rb