Prevent CSRF bypass unblocking users
This commit is contained in:
parent
7810734ac4
commit
c49e400aa3
2 changed files with 9 additions and 2 deletions
|
@ -79,7 +79,7 @@ class UserBlocksController < ApplicationController
|
|||
##
|
||||
# revokes the block, setting the end_time to now
|
||||
def revoke
|
||||
if params[:confirm] && @user_block.revoke!(current_user)
|
||||
if request.post? && params[:confirm] && @user_block.revoke!(current_user)
|
||||
flash[:notice] = t ".flash"
|
||||
redirect_to(@user_block)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue