diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/concerns/spammable_actions.rb | 2 | ||||
-rw-r--r-- | app/controllers/registrations_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/sessions_controller.rb | 5 | ||||
-rw-r--r-- | app/models/application_setting.rb | 1 |
4 files changed, 3 insertions, 7 deletions
diff --git a/app/controllers/concerns/spammable_actions.rb b/app/controllers/concerns/spammable_actions.rb index d0a692070d9..004872ff4ca 100644 --- a/app/controllers/concerns/spammable_actions.rb +++ b/app/controllers/concerns/spammable_actions.rb @@ -35,7 +35,7 @@ module SpammableActions default_params = { request: request } recaptcha_check = params[:recaptcha_verification] && - Gitlab::Recaptcha.load_configurations! && + Gitlab::Recaptcha.enabled? && verify_recaptcha return default_params unless recaptcha_check diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 1bc6520370a..1e46e25b6fb 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -13,7 +13,7 @@ class RegistrationsController < Devise::RegistrationsController params[resource_name] = params.delete(:"new_#{resource_name}") end - if !Gitlab::Recaptcha.load_configurations! || verify_recaptcha + if !Gitlab::Recaptcha.enabled? || verify_recaptcha super else flash[:alert] = 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.' diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index d7c702b94f8..345e411f30b 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -11,7 +11,6 @@ class SessionsController < Devise::SessionsController prepend_before_action :store_redirect_path, only: [:new] before_action :auto_sign_in_with_provider, only: [:new] - before_action :load_recaptcha def new set_minimum_password_length @@ -137,10 +136,6 @@ class SessionsController < Devise::SessionsController Users::ActivityService.new(user, 'login').execute end - def load_recaptcha - Gitlab::Recaptcha.load_configurations! - end - def authentication_method if user_params[:otp_attempt] "two-factor" diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 2192f76499d..ea01c48a7f5 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -171,6 +171,7 @@ class ApplicationSetting < ActiveRecord::Base after_commit do Rails.cache.write(CACHE_KEY, self) + Gitlab::Recaptcha.load_configurations! end def self.current |