From 51b32d7672fb6b0795403d5efd984433a5fdcfb4 Mon Sep 17 00:00:00 2001 From: Gaurav Ramanan Date: Thu, 28 Feb 2019 20:16:23 +0530 Subject: [PATCH] `resetPasswordRequest` event is never emitted as callback is called prematurely --- common/models/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/models/user.js b/common/models/user.js index 2c425164..5f805552 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -992,13 +992,13 @@ module.exports = function(User) { if (err) { return cb(err); } - cb(); UserModel.emit('resetPasswordRequest', { email: options.email, accessToken: accessToken, user: user, options: options, }); + cb(); } });