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"
This commit is contained in:
kirrg001 2019-02-06 20:11:44 +01:00 committed by Katharina Irrgang
parent 68bdcfc753
commit a8e0a173c2
2 changed files with 4 additions and 2 deletions

View File

@ -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))) {

View File

@ -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'
};
}