diff --git a/plugin.rb b/plugin.rb
index 3f95e2ea..957682ef 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -190,6 +190,22 @@ after_initialize do
CustomWizard::Wizard.set_wizard_redirect(user, wizard_id)
end
end
+
+ ## TODO: We shouldn't be overriding the entire method here. Make this more lightweight.
+ add_to_class(:extra_locales_controller, :show) do
+ bundle = params[:bundle]
+
+ unless URI(request.referer).path.include? '/w/'
+ raise Discourse::InvalidAccess.new if bundle !~ /^(admin|wizard)$/ || !current_user&.staff?
+ end
+
+ if params[:v]&.size == 32
+ hash = ExtraLocalesController.bundle_js_hash(bundle)
+ immutable_for(24.hours) if hash == params[:v]
+ end
+
+ render plain: ExtraLocalesController.bundle_js(bundle), content_type: "application/javascript"
+ end
DiscourseEvent.trigger(:custom_wizard_ready)
end
diff --git a/views/layouts/wizard.html.erb b/views/layouts/wizard.html.erb
index 1b92d28d..251d13ed 100644
--- a/views/layouts/wizard.html.erb
+++ b/views/layouts/wizard.html.erb
@@ -17,7 +17,7 @@
<%= preload_script "wizard-plugin" %>
<%= preload_script "pretty-text-bundle" %>
<%= preload_script "locales/#{I18n.locale}" %>
-
+
<%= csrf_meta_tags %>
<%- unless customization_disabled? %>