Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using try_spree_current_user #221

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
original "904c52ff702412d1dc8d55ff44d87d7f581f6675"
-->

<% if @user != try_spree_current_user %>
<% if @user != spree_current_user %>
<fieldset class="no-border-bottom" data-hook="admin_user_reset_password">
<legend><%= t(:'spree.forgot_password') %></legend>

Expand Down
4 changes: 2 additions & 2 deletions lib/spree/auth/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<% if spree_current_user %>
<ul id="login-nav" class="admin-login-nav">
<li data-hook="user-account-link">
<% if can?(:admin, try_spree_current_user) %>
<%= link_to spree.edit_admin_user_path(try_spree_current_user) do %>
<% if can?(:admin, spree_current_user) %>
<%= link_to spree.edit_admin_user_path(spree_current_user) do %>
<i class='fa fa-user'></i>
<%= try_spree_current_user.email %>
<%= spree_current_user.email %>
<% end %>
<% else %>
<a>
<i class='fa fa-user'></i>
<%= try_spree_current_user.email %>
<%= spree_current_user.email %>
</a>
<% end %>
</li>
Expand Down