Add audit event for ownership transfer

This commit is contained in:
Girish Ramakrishnan
2018-07-05 13:51:22 -07:00
parent 75f9b19db2
commit 6810c61e58
3 changed files with 7 additions and 3 deletions

View File

@@ -166,7 +166,7 @@ function transferOwnership(req, res, next) {
if (typeof req.body.ownerId !== 'string') return next(new HttpError(400, 'ownerId must be a string'));
users.transferOwnership(req.params.userId, req.body.ownerId, function (error) {
users.transferOwnership(req.params.userId, req.body.ownerId, auditSource(req), function (error) {
if (error && error.reason === UsersError.NOT_FOUND) return next(new HttpError(404, 'No such user'));
if (error) return next(new HttpError(500, error));