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 'app/helpers/recaptcha_helper.rb')
-rw-r--r--app/helpers/recaptcha_helper.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/helpers/recaptcha_helper.rb b/app/helpers/recaptcha_helper.rb
index 59f0dc8f819..b6b75d03b2e 100644
--- a/app/helpers/recaptcha_helper.rb
+++ b/app/helpers/recaptcha_helper.rb
@@ -2,27 +2,17 @@
module RecaptchaHelper
def recaptcha_enabled?
- return false if gitlab_qa?
+ return false if Gitlab::Qa.request?(request.user_agent)
!!Gitlab::Recaptcha.enabled?
end
alias_method :show_recaptcha_sign_up?, :recaptcha_enabled?
def recaptcha_enabled_on_login?
- return false if gitlab_qa?
+ return false if Gitlab::Qa.request?(request.user_agent)
Gitlab::Recaptcha.enabled_on_login?
end
-
- private
-
- def gitlab_qa?
- return false unless Gitlab.com?
- return false unless request.user_agent.present?
- return false unless Gitlab::Environment.qa_user_agent.present?
-
- ActiveSupport::SecurityUtils.secure_compare(request.user_agent, Gitlab::Environment.qa_user_agent)
- end
end
RecaptchaHelper.prepend_mod