Skip to content

Commit

Permalink
cannot access teams feature (#4774)
Browse files Browse the repository at this point in the history
Fixes #4770
  • Loading branch information
alexr00 authored Apr 26, 2023
1 parent 7a364d9 commit 68ddc43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/github/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class CredentialStore implements vscode.Disposable {

let usedScopes: string[];

if (getAuthSessionOptions.createIfNone && !getAuthSessionOptions.forceNewSession) {
if (getAuthSessionOptions.createIfNone && !getAuthSessionOptions.forceNewSession && (scopes.length === SCOPES.length)) {
const silent = getAuthSessionOptions.silent;
getAuthSessionOptions.createIfNone = false;
getAuthSessionOptions.silent = true;
Expand All @@ -327,7 +327,7 @@ export class CredentialStore implements vscode.Disposable {
session = await vscode.authentication.getSession(authProviderId, scopes, getAuthSessionOptions);
usedScopes = scopes;
}
} else if (getAuthSessionOptions.forceNewSession) {
} else if (getAuthSessionOptions.forceNewSession || scopes.length === SCOPES_WITH_ADDITIONAL.length) {
session = await vscode.authentication.getSession(authProviderId, scopes, getAuthSessionOptions);
usedScopes = scopes;
} else {
Expand Down

0 comments on commit 68ddc43

Please sign in to comment.