From 95971906192dbe3921185274593bb013e998b7af Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Thu, 30 Jun 2022 11:24:27 +0200 Subject: [PATCH] Stop using try_spree_current_user The current gem is defining `spree_current_user` so we don't need to be defensive about using it directly. Related to https://github.com/solidusio/solidus/pull/3923. --- .../users/edit/_add_reset_password_form.html.erb.deface | 2 +- lib/spree/auth/engine.rb | 4 ++-- .../spree/admin/shared/_navigation_footer.html.erb | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface b/app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface index 083d9f0e..59ee89fd 100644 --- a/app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface +++ b/app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface @@ -3,7 +3,7 @@ original "904c52ff702412d1dc8d55ff44d87d7f581f6675" --> -<% if @user != try_spree_current_user %> +<% if @user != spree_current_user %>
<%= t(:'spree.forgot_password') %> diff --git a/lib/spree/auth/engine.rb b/lib/spree/auth/engine.rb index 6e6743a1..e4d21e7b 100644 --- a/lib/spree/auth/engine.rb +++ b/lib/spree/auth/engine.rb @@ -48,7 +48,7 @@ def self.redirect_back_on_unauthorized? def self.prepare_backend Spree::Admin::BaseController.unauthorized_redirect = -> do - if try_spree_current_user + if spree_current_user flash[:error] = I18n.t('spree.authorization_failure') if Spree::Auth::Engine.redirect_back_on_unauthorized? @@ -71,7 +71,7 @@ def self.prepare_backend def self.prepare_frontend Spree::BaseController.unauthorized_redirect = -> do - if try_spree_current_user + if spree_current_user flash[:error] = I18n.t('spree.authorization_failure') if Spree::Auth::Engine.redirect_back_on_unauthorized? diff --git a/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb b/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb index 92e93e30..cc0a2066 100644 --- a/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb +++ b/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb @@ -1,15 +1,15 @@ <% if spree_current_user %>