Skip to content

Commit

Permalink
become redirect & menu avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Aug 11, 2023
1 parent 913f6c1 commit 4638b69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def become
if current_user.is_admin?
user = User.find(params[:id])
sign_in(:user, user)
redirect_to root_url, notice: "logged in as #{user.username}"
else
redirect_to root_url, error: "not allowed"
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_user_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
>
<span class="sr-only"><%= gettext("Notifications") %></span>

<% #= image_tag(current_user, :small) %>
<%= image_tag(current_user.avatar_url(:small), class: "h-6 w-6 rounded-full") %>
</button>

<button
Expand Down

0 comments on commit 4638b69

Please sign in to comment.