🚧 Added req.member to the v2 api context object

closes #10112
This commit is contained in:
Fabien O'Carroll 2018-11-07 18:01:27 +07:00
parent 2a6e9aac55
commit 7323258415
2 changed files with 4 additions and 2 deletions

View File

@ -15,7 +15,8 @@ const http = (apiImpl) => {
user: req.user,
context: {
api_key_id: (req.api_key && req.api_key.id) ? req.api_key.id : null,
user: ((req.user && req.user.id) || (req.user && models.User.isExternalUser(req.user.id))) ? req.user.id : null
user: ((req.user && req.user.id) || (req.user && models.User.isExternalUser(req.user.id))) ? req.user.id : null,
member: (req.member || null)
}
});

View File

@ -46,7 +46,8 @@ describe('Unit: api/shared/http', function () {
apiImpl.args[0][0].options.should.eql({
context: {
api_key_id: null,
user: null
user: null,
member: null
}
});
});