summaryrefslogtreecommitdiff
path: root/lib/omni_auth/request_forgery_protection.rb
blob: 69155131d8d72b837d68413270b6632f2cb9e4e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Protects OmniAuth request phase against CSRF.

module OmniAuth
  module RequestForgeryProtection
    class Controller < ActionController::Base
      protect_from_forgery with: :exception

      def index
        head :ok
      end
    end

    def self.app
      @app ||= Controller.action(:index)
    end

    def self.call(env)
      app.call(env)
    end
  end
end