Skip to content

Commit

Permalink
Sync up code with book version
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartl committed Jan 20, 2023
1 parent f185b5b commit 267aaa7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def user_params
# Confirms the correct user.
def correct_user
@user = User.find(params[:id])
redirect_to(root_url) unless @user == current_user
redirect_to(root_url, status: :see_other) unless current_user?(@user)
end

# Confirms an admin user.
def admin_user
redirect_to(root_url) unless current_user.admin?
redirect_to(root_url, status: :see_other) unless current_user.admin?
end
end

0 comments on commit 267aaa7

Please sign in to comment.