diff options
author | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-08-29 21:34:12 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-08-29 21:34:12 +0000 |
commit | a5b2a3786056ddf99de06c8315e9a42c3bf86cd5 (patch) | |
tree | b2e02a060e3df9a078706230ee7a6064ac4bbd85 /app/models/application_setting.rb | |
parent | e20fb7cb395e9c6594a098eddd816079259f64d9 (diff) | |
parent | dfcf4cf5f1e87a29f0d9fcc5ff2bba47258893bb (diff) | |
download | gitlab-ce-a5b2a3786056ddf99de06c8315e9a42c3bf86cd5.tar.gz |
Merge branch 'security-59549-add-capcha-for-failed-logins' into 'master'
Require a captcha after unique failed logins from the same IP
See merge request gitlab/gitlabhq!3270
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 2a99c6e5c59..855b371368d 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -75,11 +75,11 @@ class ApplicationSetting < ApplicationRecord validates :recaptcha_site_key, presence: true, - if: :recaptcha_enabled + if: :recaptcha_or_login_protection_enabled validates :recaptcha_private_key, presence: true, - if: :recaptcha_enabled + if: :recaptcha_or_login_protection_enabled validates :akismet_api_key, presence: true, @@ -292,4 +292,8 @@ class ApplicationSetting < ApplicationRecord def self.cache_backend Gitlab::ThreadMemoryCache.cache_backend end + + def recaptcha_or_login_protection_enabled + recaptcha_enabled || login_recaptcha_protection_enabled + end end |