Deliver the resetToken when an invite was sent

This commit is contained in:
Johannes Zellner
2016-04-04 18:14:07 +02:00
parent d839f0b762
commit fcfd1dceac
2 changed files with 3 additions and 3 deletions

View File

@@ -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 }));
}); });
} }

View File

@@ -442,7 +442,7 @@ function sendInvite(userId, callback) {
mailer.sendInvite(userObject, null); mailer.sendInvite(userObject, null);
callback(null); callback(null, userObject.resetToken);
}); });
}); });
} }