gitlab-org--gitlab-foss/lib/gitlab/recaptcha.rb
Toon Claes 38586061d8 Apply recaptcha API changes in 4.0
In recaptcha 4.0.0 there was an API change:

 - `public_key` -> `site_key`
 - `private_key` -> secret_key

See:
https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md
2019-03-08 15:04:04 +01:00

20 lines
471 B
Ruby

# frozen_string_literal: true
module Gitlab
module Recaptcha
def self.load_configurations!
if Gitlab::CurrentSettings.recaptcha_enabled
::Recaptcha.configure do |config|
config.site_key = Gitlab::CurrentSettings.recaptcha_site_key
config.secret_key = Gitlab::CurrentSettings.recaptcha_private_key
end
true
end
end
def self.enabled?
Gitlab::CurrentSettings.recaptcha_enabled
end
end
end