Do not attempt to purchase an app if we dont have an appstore token

This commit is contained in:
Johannes Zellner
2015-12-31 09:15:27 +01:00
parent 030faaa5d1
commit a6eca44a0d

View File

@@ -288,6 +288,9 @@ function purchase(appStoreId, callback) {
// Skip purchase if appStoreId is empty
if (appStoreId === '') return callback(null);
// Skip if we don't have an appstore token
if (config.token() === '') return callback(null);
var url = config.apiServerOrigin() + '/api/v1/apps/' + appStoreId + '/purchase';
superagent.post(url).query({ token: config.token() }).end(function (error, res) {