Skip to content

Commit 5301de8

Browse files
committed
fix: Force Selecting Account when logging in via the CLI
1 parent a3209d6 commit 5301de8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/up.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default class UpCommand extends AbstractServerCommand {
106106
.withOrg(org)
107107
.withSiteLoginUrl(
108108
// TODO switch to production URL
109-
`https://admin.hlx.page/login/${org}/${site}/main?client_id=aem-cli&redirect_uri=${encodeURIComponent(`http://localhost:${this._httpPort}/.aem/cli/login/ack`)}`,
109+
`https://admin.hlx.page/login/${org}/${site}/main?client_id=aem-cli&redirect_uri=${encodeURIComponent(`http://localhost:${this._httpPort}/.aem/cli/login/ack`)}&selectAccount=true`,
110110
);
111111
}
112112

test/server.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ describe('Helix Server', () => {
450450
.withCwd(cwd)
451451
.withHttpPort(3000)
452452
.withProxyUrl('http://main--foo--bar.aem.page')
453-
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack');
453+
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true');
454454

455455
await project.init();
456456
project.log.level = 'silly';
@@ -463,7 +463,7 @@ describe('Helix Server', () => {
463463
});
464464
assert.strictEqual(resp.status, 302);
465465
assert.ok(
466-
resp.headers.get('location').startsWith('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack&state='),
466+
resp.headers.get('location').startsWith('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true&state='),
467467
);
468468
} finally {
469469
await project.stop();
@@ -476,7 +476,7 @@ describe('Helix Server', () => {
476476
.withCwd(cwd)
477477
.withHttpPort(3000)
478478
.withProxyUrl('http://main--foo--bar.aem.page')
479-
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack');
479+
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true');
480480

481481
await project.init();
482482
project.log.level = 'silly';
@@ -509,7 +509,7 @@ describe('Helix Server', () => {
509509
.withCwd(cwd)
510510
.withHttpPort(3000)
511511
.withProxyUrl('http://main--foo--bar.aem.page')
512-
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack');
512+
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true');
513513

514514
await project.init();
515515
project.log.level = 'silly';
@@ -591,7 +591,7 @@ describe('Helix Server', () => {
591591
.withCwd(cwd)
592592
.withHttpPort(3000)
593593
.withProxyUrl('http://main--foo--bar.aem.page')
594-
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack');
594+
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true');
595595

596596
await project.init();
597597
project.log.level = 'silly';
@@ -637,7 +637,7 @@ describe('Helix Server', () => {
637637
.withCwd(cwd)
638638
.withHttpPort(3000)
639639
.withProxyUrl('http://main--foo--bar.aem.page')
640-
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack');
640+
.withSiteLoginUrl('https://admin.hlx.page/login/bar/foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true');
641641

642642
await project.init();
643643
project.log.level = 'silly';

test/up-cmd.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ describe('Integration test for up command with helix pages', function suite() {
196196
resp.headers
197197
.get('location')
198198
.startsWith(
199-
'https://admin.hlx.page/login/adobe/dummy-foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A0%2F.aem%2Fcli%2Flogin%2Fack&state=',
199+
'https://admin.hlx.page/login/adobe/dummy-foo/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A0%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true&state=',
200200
),
201201
);
202202
} catch (e) {
@@ -256,7 +256,7 @@ describe('Integration test for up command with helix pages', function suite() {
256256
resp.headers
257257
.get('location')
258258
.startsWith(
259-
'https://admin.hlx.page/login/adobe/dummy/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A0%2F.aem%2Fcli%2Flogin%2Fack&state=',
259+
'https://admin.hlx.page/login/adobe/dummy/main?client_id=aem-cli&redirect_uri=http%3A%2F%2Flocalhost%3A0%2F.aem%2Fcli%2Flogin%2Fack&selectAccount=true&state=',
260260
),
261261
);
262262
} catch (e) {

0 commit comments

Comments
 (0)