debian-mirror-gitlab/lib/omni_auth/request_forgery_protection.rb

22 lines
370 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
# Protects OmniAuth request phase against CSRF.
module OmniAuth
2015-12-23 02:04:40 +05:30
module RequestForgeryProtection
class Controller < ActionController::Base
protect_from_forgery with: :exception
2015-09-11 14:41:01 +05:30
2015-12-23 02:04:40 +05:30
def index
head :ok
2015-09-11 14:41:01 +05:30
end
end
2015-12-23 02:04:40 +05:30
def self.app
@app ||= Controller.action(:index)
2015-09-11 14:41:01 +05:30
end
2015-12-23 02:04:40 +05:30
def self.call(env)
app.call(env)
2015-09-11 14:41:01 +05:30
end
end
end