From c38010de293ad23c1feee3b9cacad2c28311546a Mon Sep 17 00:00:00 2001 From: Connor Ferguson <68167430+cpfergus1@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:14:34 -0600 Subject: [PATCH] Lint Correction Co-Authored-By: Elia Schito --- lib/spree/auth/engine.rb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/spree/auth/engine.rb b/lib/spree/auth/engine.rb index 6a8de938..b8c9e4d5 100644 --- a/lib/spree/auth/engine.rb +++ b/lib/spree/auth/engine.rb @@ -58,13 +58,11 @@ def self.prepare_backend else redirect_to spree.admin_unauthorized_path end + elsif Spree::Auth::Engine.redirect_back_on_unauthorized? + store_spree_user_location! + redirect_back(fallback_location: spree.admin_login_path) else - - if Spree::Auth::Engine.redirect_back_on_unauthorized? - redirect_back(fallback_location: spree.admin_login_path) - else - redirect_to spree.admin_login_path - end + redirect_to spree.admin_login_path end end end @@ -79,13 +77,11 @@ def self.prepare_frontend else redirect_to spree.unauthorized_path end + elsif Spree::Auth::Engine.redirect_back_on_unauthorized? + store_spree_user_location! + redirect_back(fallback_location: spree.login_path) else - - if Spree::Auth::Engine.redirect_back_on_unauthorized? - redirect_back(fallback_location: spree.login_path) - else - redirect_to spree.login_path - end + redirect_to spree.login_path end end end