From 6f058d14e67af684b1b205a57dd09c5ea9fa3673 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 26 Apr 2023 15:10:29 +0200 Subject: [PATCH] cannot access teams feature Fixes #4770 --- src/github/credentials.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/github/credentials.ts b/src/github/credentials.ts index 23ecd1d376..f6ef11018a 100644 --- a/src/github/credentials.ts +++ b/src/github/credentials.ts @@ -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; @@ -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 {