2018-10-22 03:00:50 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-12-28 15:21:34 -05:00
|
|
|
module Gitlab
|
|
|
|
module Recaptcha
|
|
|
|
def self.load_configurations!
|
2018-02-02 13:39:55 -05:00
|
|
|
if Gitlab::CurrentSettings.recaptcha_enabled
|
2015-12-28 15:21:34 -05:00
|
|
|
::Recaptcha.configure do |config|
|
2018-02-02 13:39:55 -05:00
|
|
|
config.public_key = Gitlab::CurrentSettings.recaptcha_site_key
|
|
|
|
config.private_key = Gitlab::CurrentSettings.recaptcha_private_key
|
2015-12-28 15:21:34 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
2017-01-27 11:25:39 -05:00
|
|
|
|
|
|
|
def self.enabled?
|
2018-02-02 13:39:55 -05:00
|
|
|
Gitlab::CurrentSettings.recaptcha_enabled
|
2017-01-27 11:25:39 -05:00
|
|
|
end
|
2015-12-28 15:21:34 -05:00
|
|
|
end
|
|
|
|
end
|