Skip to content

Commit

Permalink
fix: auth with url when TESTKIT_HUB_USERNAME is passed (#345)
Browse files Browse the repository at this point in the history
* fix: auth with url when TESTKIT_HUB_USERNAME is passed

* fix: revert change, now determine desired auth strategy, configure env vars with transfer
  • Loading branch information
WillieRuemmele authored Nov 29, 2022
1 parent d8d75e9 commit cb58b2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/hubAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export const testkitHubAuth = (homeDir: string, authStrategy: DevhubAuthStrategy
}
return;
}

if (authStrategy === 'AUTH_URL') {
logger('trying to authenticate with AuthUrl');

Expand Down
5 changes: 4 additions & 1 deletion src/testSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,14 @@ export class TestSession extends AsyncOptionalCreatable<TestSessionOptions> {
JSON.stringify(JSON.parse(JSON.stringify(this.options)))
);

const authStrategy =
let authStrategy =
this.options.devhubAuthStrategy === 'AUTO' ? getAuthStrategy() : this.options.devhubAuthStrategy ?? 'NONE';

transferExistingAuthToEnv(authStrategy);

authStrategy =
this.options.devhubAuthStrategy === 'AUTO' ? getAuthStrategy() : this.options.devhubAuthStrategy ?? 'NONE';

// Set the homedir used by this test, on the TestSession and the process
process.env.USERPROFILE = process.env.HOME = this.homeDir = env.getString('TESTKIT_HOMEDIR', this.dir);

Expand Down

0 comments on commit cb58b2b

Please sign in to comment.