Skip to content

Commit ad89f17

Browse files
dyhaghoalexr00
andauthored
fix: Allow Github.com auth when github-enterprise.uri is set (#7002)
* fix: Allow Github.com auth when github-enterprise.uri is set * Make proposed change --------- Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com>
1 parent 5e74067 commit ad89f17

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/github/credentials.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,13 @@ export class CredentialStore extends Disposable {
231231
// Listen for changes to the enterprise URI and try again if it changes.
232232
initBasedOnSettingChange(GITHUB_ENTERPRISE, URI, hasEnterpriseUri, initializeEnterprise, this.context.subscriptions);
233233
}
234-
let github: AuthResult | undefined;
235-
if (!enterprise) {
236-
github = await this.initialize(AuthProvider.github, options, additionalScopes ? SCOPES_WITH_ADDITIONAL : undefined, additionalScopes);
234+
const githubOptions = { ...options };
235+
if (enterprise && !enterprise.canceled) {
236+
githubOptions.silent = true;
237237
}
238+
const github = await this.initialize(AuthProvider.github, githubOptions, additionalScopes ? SCOPES_WITH_ADDITIONAL : undefined, additionalScopes);
238239
return {
239-
canceled: !!(github && github.canceled) || !!(enterprise && enterprise.canceled)
240+
canceled: github.canceled || !!(enterprise && enterprise.canceled)
240241
};
241242
}
242243

0 commit comments

Comments
 (0)