From a2d0c8c5272abaf5ac2384411bb207d45a089de2 Mon Sep 17 00:00:00 2001 From: Sascha Karnatz <122262394+sascha-karnatz@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:31:54 +0100 Subject: [PATCH] Fix --- app/controllers/alchemy/base_controller.rb | 10 ++++------ app/javascript/alchemy_admin.js | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/controllers/alchemy/base_controller.rb b/app/controllers/alchemy/base_controller.rb index 3cd249c036..726638abc0 100644 --- a/app/controllers/alchemy/base_controller.rb +++ b/app/controllers/alchemy/base_controller.rb @@ -54,13 +54,11 @@ def permission_denied(exception = nil) WARN end if request.format.json? - render json: {message: Alchemy.t("You are not authorized") }, status: :unauthorized + render json: {message: Alchemy.t("You are not authorized")}, status: :unauthorized + elsif current_alchemy_user + handle_redirect_for_user else - if current_alchemy_user - handle_redirect_for_user - else - handle_redirect_for_guest - end + handle_redirect_for_guest end end diff --git a/app/javascript/alchemy_admin.js b/app/javascript/alchemy_admin.js index e2d4242c4d..71799f9e80 100644 --- a/app/javascript/alchemy_admin.js +++ b/app/javascript/alchemy_admin.js @@ -62,7 +62,6 @@ setDefaultAnimation("tooltip.hide", { } }) - // Global Alchemy object if (typeof window.Alchemy === "undefined") { window.Alchemy = {}