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

Move configuration block to ensure it only runs once

Oliver Günthercf6117b6a8e3
diff --git a/modules/recaptcha/lib/open_project/recaptcha/engine.rb b/modules/recaptcha/lib/open_project/recaptcha/engine.rb
index b0476d567c2..72d5b134c08 100644
--- a/modules/recaptcha/lib/open_project/recaptcha/engine.rb
+++ b/modules/recaptcha/lib/open_project/recaptcha/engine.rb
@@ -23,6 +23,10 @@ module OpenProject::Recaptcha
end
config.after_initialize do
+ SecureHeaders::Configuration.named_append(:recaptcha) do |request|
+ { frame_src: %w(https://www.google.com/recaptcha/) }
+ end
+
OpenProject::Authentication::Stage.register(:recaptcha,
nil,
run_after_activation: true,
@@ -33,12 +37,5 @@ module OpenProject::Recaptcha
recaptcha_request_path
end
end
-
- config.to_prepare do
- SecureHeaders::Configuration.named_append(:recaptcha) do |request|
- { frame_src: %w(https://www.google.com/recaptcha/) }
- end
-
- end
end
end