summaryrefslogtreecommitdiff
path: root/lib/gitlab/recaptcha.rb
diff options
context:
space:
mode:
authorMałgorzata Ksionek <mksionek@gitlab.com>2019-07-18 10:27:02 +0200
committerMałgorzata Ksionek <mksionek@gitlab.com>2019-07-31 11:47:55 +0200
commitdfcf4cf5f1e87a29f0d9fcc5ff2bba47258893bb (patch)
tree9343675b9a675bc87236e2b65f4b9d2af18762c2 /lib/gitlab/recaptcha.rb
parentd93da8888bd54531e5f5df2047902ae90635b8d0 (diff)
downloadgitlab-ce-dfcf4cf5f1e87a29f0d9fcc5ff2bba47258893bb.tar.gz
Add captcha if there are multiple failed login attempts
Add method to store session ids by ip Add new specs for storing session ids Add cleaning up records after login Add retrieving anonymous sessions Add login recaptcha setting Add new setting to sessions controller Add conditions for showing captcha Add sessions controller specs Add admin settings specs for login protection Add new settings to api Add stub to devise spec Add new translation key Add cr remarks Rename class call Add cr remarks Change if-clause for consistency Add cr remarks Add code review remarks Refactor AnonymousSession class Add changelog entry Move AnonymousSession class to lib Move store unauthenticated sessions to sessions controller Move link to recaptcha info Regenerate text file Improve copy on the spam page Change action filter for storing anonymous sessions Fix rubocop offences Add code review remarks
Diffstat (limited to 'lib/gitlab/recaptcha.rb')
-rw-r--r--lib/gitlab/recaptcha.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/recaptcha.rb b/lib/gitlab/recaptcha.rb
index 772d743c9b0..f3cbe1db901 100644
--- a/lib/gitlab/recaptcha.rb
+++ b/lib/gitlab/recaptcha.rb
@@ -3,7 +3,7 @@
module Gitlab
module Recaptcha
def self.load_configurations!
- if Gitlab::CurrentSettings.recaptcha_enabled
+ if Gitlab::CurrentSettings.recaptcha_enabled || enabled_on_login?
::Recaptcha.configure do |config|
config.site_key = Gitlab::CurrentSettings.recaptcha_site_key
config.secret_key = Gitlab::CurrentSettings.recaptcha_private_key
@@ -16,5 +16,9 @@ module Gitlab
def self.enabled?
Gitlab::CurrentSettings.recaptcha_enabled
end
+
+ def self.enabled_on_login?
+ Gitlab::CurrentSettings.login_recaptcha_protection_enabled
+ end
end
end