diff --git a/src/routes/users.js b/src/routes/users.js index 6dbfcb0db..1766be104 100644 --- a/src/routes/users.js +++ b/src/routes/users.js @@ -37,17 +37,7 @@ function create(req, res, next) { users.create(username, password, email, displayName, { invitor: req.user, admin: req.body.admin }, auditSource.fromRequest(req), function (error, user) { if (error) return next(BoxError.toHttpError(error)); - var userInfo = { - id: user.id, - username: user.username, - displayName: user.displayName, - email: user.email, - fallbackEmail: user.fallbackEmail, - groupIds: [ ], - resetToken: user.resetToken - }; - - next(new HttpSuccess(201, userInfo)); + next(new HttpSuccess(201, users.removePrivateFields(user))); }); }