From a25ddb004ac58eb0cd765cdf89e91ab599fa5791 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 13 Mar 2021 20:43:03 -0300 Subject: [PATCH] =?UTF-8?q?cerrar=20la=20sesi=C3=B3n=20en=20lugar=20de=20d?= =?UTF-8?q?ar=20un=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #290 closes #261 closes #232 closes #237 closes #238 closes #239 --- app/controllers/application_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9893daa..06a23e1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base include ExceptionHandler - protect_from_forgery with: :exception, prepend: true + protect_from_forgery with: forgery_method, prepend: true before_action :prepare_exception_notifier before_action :configure_permitted_parameters, if: :devise_controller? @@ -54,6 +54,10 @@ class ApplicationController < ActionController::Base render 'application/page_not_found', status: :not_found end + def forgery_method + Rails.env.production? ? :null_session : :exception + end + protected def configure_permitted_parameters