Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb')
-rw-r--r--config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb b/config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb
new file mode 100644
index 00000000000..760fcba5935
--- /dev/null
+++ b/config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module OmniAuth
+ module Strategies
+ class OAuth2
+ alias_method :original_callback_phase, :callback_phase
+
+ # Monkey patch until PR is merged and released upstream
+ # https://github.com/omniauth/omniauth-oauth2/pull/129
+ def callback_phase
+ original_callback_phase
+ rescue ::Faraday::TimeoutError, ::Faraday::ConnectionFailed => e
+ fail!(:timeout, e)
+ end
+ end
+ end
+end