lib/cybele/helpers/devise.rb in cybele-2.0.0 vs lib/cybele/helpers/devise.rb in cybele-2.1.0

- old
+ new

@@ -31,13 +31,19 @@ inject_into_file 'app/controllers/hq/application_controller.rb', template_content('devise/devise_authenticate_admin.rb.erb'), after: 'class Hq::ApplicationController < ApplicationController' end + def add_devise_protect_from_forgery + inject_into_file 'app/controllers/application_controller.rb', + template_content('devise/devise_protect_from_forgery.rb.erb'), + after: 'respond_to :html, :js, :json' + end + def add_devise_strong_parameter inject_into_file 'app/controllers/application_controller.rb', template_content('devise/devise_strong_parameter.rb.erb'), - after: 'protect_from_forgery with: :exception' + after: 'protect_from_forgery with: :exception, prepend: true' inject_into_file 'app/controllers/application_controller.rb', template_content('devise/devise_before_action_strong_parameter.rb.erb'), after: 'class ApplicationController < ActionController::Base' end