From 2596afa7b3dbc4568c5667dc5bd79cf6ef8dcc31 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 18 May 2022 23:30:30 -0700 Subject: [PATCH] appstore: set utmSource during user registration --- src/appstore.js | 2 +- src/routes/test/appstore-test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/appstore.js b/src/appstore.js index da384134f..e8f8002c7 100644 --- a/src/appstore.js +++ b/src/appstore.js @@ -100,7 +100,7 @@ async function registerUser(email, password) { assert.strictEqual(typeof password, 'string'); const [error, response] = await safe(superagent.post(`${settings.apiServerOrigin()}/api/v1/register_user`) - .send({ email, password }) + .send({ email, password, utmSource: 'cloudron-dashboard' }) .timeout(30 * 1000) .ok(() => true)); diff --git a/src/routes/test/appstore-test.js b/src/routes/test/appstore-test.js index f0eed273d..2cb008efe 100644 --- a/src/routes/test/appstore-test.js +++ b/src/routes/test/appstore-test.js @@ -85,7 +85,7 @@ describe('Appstore Cloudron Registration API - existing user', function () { it('can setup subscription', async function () { const scope1 = nock(settings.apiServerOrigin()) - .post('/api/v1/register_user', (body) => body.email && body.password) + .post('/api/v1/register_user', (body) => body.email && body.password && body.utmSource) .reply(201, {}); const scope2 = nock(settings.apiServerOrigin()) @@ -142,7 +142,7 @@ describe('Appstore Cloudron Registration API - new user signup', function () { it('can setup subscription', async function () { const scope1 = nock(settings.apiServerOrigin()) - .post('/api/v1/register_user', (body) => body.email && body.password) + .post('/api/v1/register_user', (body) => body.email && body.password && body.utmSource) .reply(201, {}); const scope2 = nock(settings.apiServerOrigin())