Module: Alchemy::Solidus::SpreeAdminBaseControllerPatch

Defined in:
lib/patches/backend/controllers/alchemy/solidus/spree_admin_base_controller_patch.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/patches/backend/controllers/alchemy/solidus/spree_admin_base_controller_patch.rb', line 6

def self.prepended(base)
  if Alchemy.user_class_name == "::Alchemy::User"
    base.unauthorized_redirect = -> do
      if spree_current_user
        flash[:error] = I18n.t("spree.authorization_failure")
        redirect_to spree.root_path
      else
        store_location
        redirect_to Alchemy.
      end
    end
  end
end