Sha256: 71338d876ebbfab9d2fb81c15d36e76eae466be1f43911a17ca80a49f6d19148

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

module Gemgento
  module Magento
    class BaseController < Gemgento::ApplicationController

      skip_before_action :verify_authenticity_token
      before_filter :validate_ip

      def validate_ip
        whitelist = Config[:magento][:ip_whitelist].to_s.split(',').map(&:strip)

        if Rails.env.production? && !whitelist.include?(request.remote_ip.to_s)
          raise ActionController::RoutingError.new('Not Found')
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/controllers/gemgento/magento/base_controller.rb