gitlab-org--gitlab-foss/lib/omni_auth/request_forgery_protection.rb

22 lines
370 B
Ruby
Raw Normal View History

# Protects OmniAuth request phase against CSRF.
module OmniAuth
2015-12-08 13:41:19 +00:00
module RequestForgeryProtection
class Controller < ActionController::Base
protect_from_forgery with: :exception
2015-12-08 13:41:19 +00:00
def index
head :ok
end
end
2015-12-08 13:41:19 +00:00
def self.app
@app ||= Controller.action(:index)
end
2015-12-08 13:41:19 +00:00
def self.call(env)
app.call(env)
end
end
end