Deliver the resetToken when an invite was sent
This commit is contained in:
@@ -214,11 +214,11 @@ function requireAdmin(req, res, next) {
|
|||||||
function sendInvite(req, res, next) {
|
function sendInvite(req, res, next) {
|
||||||
assert.strictEqual(typeof req.params.userId, 'string');
|
assert.strictEqual(typeof req.params.userId, 'string');
|
||||||
|
|
||||||
user.sendInvite(req.params.userId, function (error) {
|
user.sendInvite(req.params.userId, function (error, result) {
|
||||||
if (error && error.reason === UserError.NOT_FOUND) return next(new HttpError(404, 'User not found'));
|
if (error && error.reason === UserError.NOT_FOUND) return next(new HttpError(404, 'User not found'));
|
||||||
if (error) return next(new HttpError(500, error));
|
if (error) return next(new HttpError(500, error));
|
||||||
|
|
||||||
next(new HttpSuccess(200, {}));
|
next(new HttpSuccess(200, { resetToken: result }));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ function sendInvite(userId, callback) {
|
|||||||
|
|
||||||
mailer.sendInvite(userObject, null);
|
mailer.sendInvite(userObject, null);
|
||||||
|
|
||||||
callback(null);
|
callback(null, userObject.resetToken);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user