From ffd3f5f158e076078200da55bf8ed442f54d4f84 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 3 May 2018 17:53:07 +0630 Subject: [PATCH] check exception in check_user --- app/controllers/base_origami_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index 66cc2880..3cb1eacc 100755 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -5,7 +5,6 @@ class BaseOrigamiController < ActionController::Base before_action :check_user #before_action :check_installation - protect_from_forgery with: :exception helper_method :shop_detail, :current_token @@ -23,6 +22,10 @@ class BaseOrigamiController < ActionController::Base }.to_json end else + if ENV["SERVER_MODE"] != 'cloud' + protect_from_forgery with: :exception + end + if current_user.nil? redirect_to root_path end