From 6d482e38cd0b9267ed4f9be04b9286ec89e7b9db Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 10 Oct 2024 14:50:19 -0700 Subject: [PATCH] No longer look at `sessions[0]` (#231063) We don't need to do this anymore now that account preference is kept across sessions. --- extensions/github-authentication/src/github.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/extensions/github-authentication/src/github.ts b/extensions/github-authentication/src/github.ts index d4ae337427c..8a363d7dd33 100644 --- a/extensions/github-authentication/src/github.ts +++ b/extensions/github-authentication/src/github.ts @@ -332,11 +332,8 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid }); const sessions = await this._sessionsPromise; - - // First we use the account specified in the options, otherwise we use the first account we have to seed auth. - const loginWith = options?.account?.label ?? sessions[0]?.account.label; + const loginWith = options?.account?.label; this._logger.info(`Logging in with '${loginWith ? loginWith : 'any'}' account...`); - const scopeString = sortedScopes.join(' '); const token = await this._githubServer.login(scopeString, loginWith); const session = await this.tokenToSession(token, scopes);