2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-09 19:03:09 +08:00

FIX: revoke any api keys when suspending an user

This commit is contained in:
Régis Hanol 2015-08-23 22:33:03 +02:00
parent 91519fdfe7
commit 73624e63c5
2 changed files with 12 additions and 1 deletions

View file

@ -53,6 +53,7 @@ class Admin::UsersController < Admin::AdminController
@user.suspended_till = params[:duration].to_i.days.from_now
@user.suspended_at = DateTime.now
@user.save!
@user.revoke_api_key
StaffActionLogger.new(current_user).log_user_suspend(@user, params[:reason])
MessageBus.publish "/logout", @user.id, user_ids: [@user.id]
render nothing: true