aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-22 11:35:24 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-22 11:35:24 +0100
commite2a48d60bba1c3444d2e6d8186dc7f90d2b0e416 (patch)
treea0a9ce30b9e9177545d2e4a614db2773431ddb17 /plugins
parent84673d1d4ede9f69e6210438a198456fe010366c (diff)
downloadprosody-e2a48d60bba1c3444d2e6d8186dc7f90d2b0e416.tar.gz
prosody-e2a48d60bba1c3444d2e6d8186dc7f90d2b0e416.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_register_ibr.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/mod_register_ibr.lua b/plugins/mod_register_ibr.lua
index 000ae740..83d284c8 100644
--- a/plugins/mod_register_ibr.lua
+++ b/plugins/mod_register_ibr.lua
@@ -186,6 +186,7 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event)
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);