mod_easy_invite: Invalidate password reset tokens after use
Requires Prosody 84441c19750e
This commit is contained in:
parent
395ab8d404
commit
4d550e0998
|
@ -194,6 +194,15 @@ module:hook("user-registered", function (event)
|
|||
end
|
||||
end);
|
||||
|
||||
-- Equivalent of user-registered but for when the account already existed
|
||||
-- (i.e. password reset)
|
||||
module:hook("user-password-reset", function (event)
|
||||
local validated_invite = event.validated_invite or (event.session and event.session.validated_invite);
|
||||
if not validated_invite then
|
||||
return;
|
||||
end
|
||||
validated_invite:use();
|
||||
end);
|
||||
|
||||
local sm = require "core.storagemanager";
|
||||
function module.command(arg)
|
||||
|
|
Loading…
Reference in New Issue