mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Log password changes in UserHistory (#6600)
This commit is contained in:

committed by
Guo Xiang Tan

parent
38a9bc740d
commit
17bc82765b
@ -497,6 +497,11 @@ class UsersController < ApplicationController
|
||||
Invite.invalidate_for_email(@user.email) # invite link can't be used to log in anymore
|
||||
secure_session["password-#{token}"] = nil
|
||||
secure_session["second-factor-#{token}"] = nil
|
||||
UserHistory.create!(
|
||||
target_user: @user,
|
||||
acting_user: @user,
|
||||
action: UserHistory.actions[:change_password]
|
||||
)
|
||||
logon_after_password_reset
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user