Module: Gitlab::Recaptcha

Defined in:
lib/gitlab/recaptcha.rb

Class Method Summary collapse

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/gitlab/recaptcha.rb', line 16

def self.enabled?
  Gitlab::CurrentSettings.recaptcha_enabled
end

.enabled_on_login?Boolean

Returns:

  • (Boolean)

20
21
22
# File 'lib/gitlab/recaptcha.rb', line 20

def self.enabled_on_login?
  Gitlab::CurrentSettings.
end

.load_configurations!Object


5
6
7
8
9
10
11
12
13
14
# File 'lib/gitlab/recaptcha.rb', line 5

def self.load_configurations!
  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
    end

    true
  end
end