From a8e0a173c27c65959ac29e38d733a2f6e68e9f27 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Wed, 6 Feb 2019 20:11:44 +0100 Subject: [PATCH] Redefined context.integration no issue - we only have access to the ID at the moment - we really don't want to end up in the same situation as with "context.user" --- core/server/api/shared/http.js | 4 +++- core/server/models/base/index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/server/api/shared/http.js b/core/server/api/shared/http.js index 5c3e544c85..bed5cb3008 100644 --- a/core/server/api/shared/http.js +++ b/core/server/api/shared/http.js @@ -15,7 +15,9 @@ const http = (apiImpl) => { id: req.api_key.get('id'), type: req.api_key.get('type') }; - integration = req.api_key.get('integration_id'); + integration = { + id: req.api_key.get('integration_id') + }; } if ((req.user && req.user.id) || (req.user && models.User.isExternalUser(req.user.id))) { diff --git a/core/server/models/base/index.js b/core/server/models/base/index.js index cdfd40b8b1..3236affa48 100644 --- a/core/server/models/base/index.js +++ b/core/server/models/base/index.js @@ -445,7 +445,7 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({ getActor(options = {context: {}}) { if (options.context.integration) { return { - id: options.context.integration, + id: options.context.integration.id, type: 'integration' }; }