I have a piece of code that looks something like:
let httpClient = addon.httpClient(req).asUserByAccountId(req.context.userAccountId);
httpClient.get({
url: '/rest/api/content/XXXX',
headers: {
'X-Atlassian-Token': 'nocheck'
},
},
function (err, resp, body) {
if (err) {
// ERR
} else {
// SUCCESS
}
});
Despite having ACT_AS_USER in the scope, and I can see that there is a valid User Account ID and Client ID in the request context, I keep getting:
error TypeError: Cannot read property 'access_token' of undefined
at /node_modules/atlassian-connect-express/lib/internal/host-request.js:183:59
I can’t figure out if this is an ACE problem or rejection by the host.