Generate the user invite link only in one location

This commit is contained in:
Johannes Zellner
2020-02-05 15:53:05 +01:00
parent 68b1d1dde1
commit 1fbbaa82ab
4 changed files with 14 additions and 9 deletions

View File

@@ -124,10 +124,10 @@ function verifyPassword(req, res, next) {
function createInvite(req, res, next) {
assert.strictEqual(typeof req.params.userId, 'string');
users.createInvite(req.params.userId, function (error, resetToken) {
users.createInvite(req.params.userId, function (error, result) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { resetToken: resetToken }));
next(new HttpSuccess(200, result));
});
}