Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

register recaptcha config to make it work again

Markus Kahlcba3c1ca42f2
diff --git a/modules/recaptcha/lib/open_project/recaptcha/configuration.rb b/modules/recaptcha/lib/open_project/recaptcha/configuration.rb
index 94cfede8239..3f77986fb14 100644
--- a/modules/recaptcha/lib/open_project/recaptcha/configuration.rb
+++ b/modules/recaptcha/lib/open_project/recaptcha/configuration.rb
@@ -1,10 +1,12 @@
module OpenProject
module Recaptcha
module Configuration
+ CONFIG_KEY = 'recaptcha_via_hcaptcha'.freeze
+
extend self
def use_hcaptcha?
- OpenProject::Configuration['recaptcha_via_hcaptcha']
+ OpenProject::Configuration[CONFIG_KEY]
end
def hcaptcha_response_limit
diff --git a/modules/recaptcha/lib/open_project/recaptcha/engine.rb b/modules/recaptcha/lib/open_project/recaptcha/engine.rb
index e845dfeda8b..f640f578cf3 100644
--- a/modules/recaptcha/lib/open_project/recaptcha/engine.rb
+++ b/modules/recaptcha/lib/open_project/recaptcha/engine.rb
@@ -22,6 +22,10 @@ module OpenProject::Recaptcha
caption: ->(*) { I18n.t('recaptcha.label_recaptcha') }
end
+ initializer "openproject.configuration" do
+ ::Settings::Definition.add OpenProject::Recaptcha::Configuration::CONFIG_KEY, value: false
+ end
+
config.after_initialize do
SecureHeaders::Configuration.named_append(:recaptcha) do
if OpenProject::Recaptcha.use_hcaptcha?