From 65b4c83b75bb9ee9c498cfedfd858c9c47a624b3 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 3 Aug 2016 22:41:40 +0200 Subject: [PATCH] Use the correct token when calling the appstore for purchase --- src/apps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps.js b/src/apps.js index fa45125de..d9c5dbee8 100644 --- a/src/apps.js +++ b/src/apps.js @@ -375,7 +375,7 @@ function purchase(appId, appstoreId, callback) { var url = config.apiServerOrigin() + '/api/v1/users/' + result.userId + '/cloudrons/' + result.cloudronId + '/apps/' + appId; var data = { appstoreId: appstoreId }; - superagent.post(url).send(data).query({ token: config.token() }).end(function (error, result) { + superagent.post(url).send(data).query({ accessToken: result.token }).end(function (error, result) { if (error && !error.response) return callback(new AppsError(AppsError.EXTERNAL_ERROR, error)); if (result.statusCode === 404) return callback(new AppsError(AppsError.NOT_FOUND)); if (result.statusCode !== 201 && result.statusCode !== 200) return callback(new AppsError(AppsError.EXTERNAL_ERROR, util.format('App purchase failed. %s %j', result.status, result.body)));