From 73232584154ae7c16acc0ba10eaa7804715f187f Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 7 Nov 2018 18:01:27 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Added=20req.member=20to=20the=20?= =?UTF-8?q?v2=20api=20context=20object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #10112 --- core/server/api/shared/http.js | 3 ++- core/test/unit/api/shared/http_spec.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/server/api/shared/http.js b/core/server/api/shared/http.js index 6a36baa4a6..e6940c46ba 100644 --- a/core/server/api/shared/http.js +++ b/core/server/api/shared/http.js @@ -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) } }); diff --git a/core/test/unit/api/shared/http_spec.js b/core/test/unit/api/shared/http_spec.js index 4b111bc8b4..6d3ffc14c9 100644 --- a/core/test/unit/api/shared/http_spec.js +++ b/core/test/unit/api/shared/http_spec.js @@ -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 } }); });