BigW Consortium Gitlab

request_forgery_protection.rb 370 Bytes
Newer Older
1 2 3
# Protects OmniAuth request phase against CSRF.

module OmniAuth
4 5 6
  module RequestForgeryProtection
    class Controller < ActionController::Base
      protect_from_forgery with: :exception
7

8 9
      def index
        head :ok
10 11 12
      end
    end

13 14
    def self.app
      @app ||= Controller.action(:index)
15 16
    end

17 18
    def self.call(env)
      app.call(env)
19 20 21
    end
  end
end