Commit cc3a82bc authored by blackst0ne's avatar blackst0ne Committed by Douwe Maan

Add `rescue false`.

parent 8ce8b21f
...@@ -16,7 +16,7 @@ OmniAuth.config.allowed_request_methods = [:post] ...@@ -16,7 +16,7 @@ OmniAuth.config.allowed_request_methods = [:post]
# In case of auto sign-in, the GET method is used (users don't get to click on a button) # In case of auto sign-in, the GET method is used (users don't get to click on a button)
OmniAuth.config.allowed_request_methods << :get if Gitlab.config.omniauth.auto_sign_in_with_provider.present? OmniAuth.config.allowed_request_methods << :get if Gitlab.config.omniauth.auto_sign_in_with_provider.present?
OmniAuth.config.before_request_phase do |env| OmniAuth.config.before_request_phase do |env|
GitLab::RequestForgeryProtection.call(env) Gitlab::RequestForgeryProtection.call(env)
end end
if Gitlab.config.omniauth.enabled if Gitlab.config.omniauth.enabled
......
...@@ -338,7 +338,7 @@ module API ...@@ -338,7 +338,7 @@ module API
# Check if CSRF tokens are valid. # Check if CSRF tokens are valid.
def verified_request? def verified_request?
GitLab::RequestForgeryProtection.call(env) Gitlab::RequestForgeryProtection.call(env) rescue false
end end
# Check the Rails session for valid authentication details # Check the Rails session for valid authentication details
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# It's used in API helpers and OmniAuth. # It's used in API helpers and OmniAuth.
# Usage: GitLab::RequestForgeryProtection.call(env) # Usage: GitLab::RequestForgeryProtection.call(env)
module GitLab module Gitlab
module RequestForgeryProtection module RequestForgeryProtection
class Controller < ActionController::Base class Controller < ActionController::Base
protect_from_forgery with: :exception protect_from_forgery with: :exception
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment