summaryrefslogtreecommitdiff
path: root/lib/gitlab/request_forgery_protection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/request_forgery_protection.rb')
-rw-r--r--lib/gitlab/request_forgery_protection.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/request_forgery_protection.rb b/lib/gitlab/request_forgery_protection.rb
index b0e15e2b655..48dd0487790 100644
--- a/lib/gitlab/request_forgery_protection.rb
+++ b/lib/gitlab/request_forgery_protection.rb
@@ -19,5 +19,13 @@ module Gitlab
def self.call(env)
app.call(env)
end
+
+ def self.verified?(env)
+ call(env)
+
+ true
+ rescue ActionController::InvalidAuthenticityToken
+ false
+ end
end
end