浏览代码

Prevent guests from accessing custom wizards

Angus McLeod 7 年之前
父节点
当前提交
760c67bb6f
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      controllers/wizard.rb

+ 4 - 0
controllers/wizard.rb

@@ -1,6 +1,10 @@
 class CustomWizard::WizardController < ::ApplicationController
   prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'views'))
   layout 'wizard'
+
+  skip_before_action :check_xhr, :preload_json
+  
+  before_action :ensure_logged_in
   helper_method :wizard_page_title
 
   def wizard_page_title