diff --git a/src/appstore.js b/src/appstore.js index ecdb4dd12..2743bd7a4 100644 --- a/src/appstore.js +++ b/src/appstore.js @@ -12,8 +12,6 @@ exports = module.exports = { getAppUpdate: getAppUpdate, getBoxUpdate: getBoxUpdate, - getAccount: getAccount, - registerCloudron: registerCloudron, sendFeedback: sendFeedback, @@ -297,24 +295,6 @@ function getAppUpdate(app, callback) { }); } -function getAccount(callback) { - assert.strictEqual(typeof callback, 'function'); - - getAppstoreConfig(function (error, appstoreConfig) { - if (error) return callback(error); - - var url = config.apiServerOrigin() + '/api/v1/users/' + appstoreConfig.userId; - - superagent.get(url).query({ accessToken: appstoreConfig.token }).timeout(10 * 1000).end(function (error, result) { - if (error && !error.response) return callback(new AppstoreError(AppstoreError.EXTERNAL_ERROR, error)); - if (result.statusCode !== 200) return callback(new AppstoreError(AppstoreError.EXTERNAL_ERROR, util.format('Bad response: %s %s', result.statusCode, result.text))); - - // { profile: { id, email, groupId, billing, firstName, lastName, company, street, city, zip, state, country } } - callback(null, result.body.profile); - }); - }); -} - function registerCloudron(adminDomain, userId, token, callback) { assert.strictEqual(typeof adminDomain, 'string'); assert.strictEqual(typeof userId, 'string'); diff --git a/src/test/appstore-test.js b/src/test/appstore-test.js index c935ce43a..3ac43ebe2 100644 --- a/src/test/appstore-test.js +++ b/src/test/appstore-test.js @@ -109,19 +109,6 @@ describe('Appstore', function () { }); }); - it('can get account', function (done) { - var scope = nock('http://localhost:6060') - .get(`/api/v1/users/${APPSTORE_USER_ID}?accessToken=${APPSTORE_TOKEN}`) - .reply(200, { profile: { id: APPSTORE_USER_ID }}); - - appstore.getAccount(function (error, result) { - expect(error).to.not.be.ok(); - expect(scope.isDone()).to.be.ok(); - expect(result.id).to.equal(APPSTORE_USER_ID); - done(); - }); - }); - it('can purchase an app', function (done) { var scope1 = nock('http://localhost:6060') .post(`/api/v1/users/${APPSTORE_USER_ID}/cloudrons/${CLOUDRON_ID}/apps/${APP_ID}?accessToken=${APPSTORE_TOKEN}`, function () { return true; })