Changeset

10946:84441c19750e

mod_register_ibr: Add event for successful password reset This is in addition to the existing event for password changes. This one includes additional details about the actor, and only triggers when the change is due to the account owner (presumably) resetting. As example use case is to invalidate one-time password reset tokens.
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Jun 2020 11:35:24 +0100
parents 10945:2edb72ef312a
children 10948:bebb384090b0
files plugins/mod_register_ibr.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_register_ibr.lua	Mon Jun 22 01:42:18 2020 +0200
+++ b/plugins/mod_register_ibr.lua	Mon Jun 22 11:35:24 2020 +0100
@@ -186,6 +186,7 @@
 		if user.allow_reset == username then
 			local ok, err = util_error.coerce(usermanager_set_password(username, password, host));
 			if ok then
+				module:fire_event("user-password-reset", user);
 				session.send(st.reply(stanza)); -- reset ok!
 			else
 				session.log("error", "Unable to reset password for %s@%s: %s", username, host, err);