Module: Gitlab::RequestForgeryProtection

Defined in:
lib/gitlab/request_forgery_protection.rb

Defined Under Namespace

Classes: Controller

Class Method Summary collapse

Class Method Details

.appObject


25
26
27
# File 'lib/gitlab/request_forgery_protection.rb', line 25

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

.call(env) ⇒ Object


29
30
31
# File 'lib/gitlab/request_forgery_protection.rb', line 29

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

.verified?(env) ⇒ Boolean

Returns:

  • (Boolean)

33
34
35
36
37
38
39
# File 'lib/gitlab/request_forgery_protection.rb', line 33

def self.verified?(env)
  call(env)

  true
rescue ActionController::InvalidAuthenticityToken
  false
end