From 0ecfad7da56ebea89f114f61e963d5a31d52cca3 Mon Sep 17 00:00:00 2001 From: Alex Weininger Date: Tue, 19 Nov 2024 11:53:26 -0800 Subject: [PATCH] Add account parameter to isSignedIn (#1819) * auth: Add account parameter to isSignedIn --- auth/src/AzureSubscriptionProvider.ts | 2 +- auth/src/VSCodeAzureSubscriptionProvider.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/src/AzureSubscriptionProvider.ts b/auth/src/AzureSubscriptionProvider.ts index 0f2d45ea62..4d7785380d 100644 --- a/auth/src/AzureSubscriptionProvider.ts +++ b/auth/src/AzureSubscriptionProvider.ts @@ -42,7 +42,7 @@ export interface AzureSubscriptionProvider { * * @returns True if the user is signed in, false otherwise. */ - isSignedIn(tenantId?: string): Promise; + isSignedIn(tenantId?: string, account?: vscode.AuthenticationSessionAccountInformation): Promise; /** * Asks the user to sign in or pick an account to use. diff --git a/auth/src/VSCodeAzureSubscriptionProvider.ts b/auth/src/VSCodeAzureSubscriptionProvider.ts index 042bf7aab4..f09ce8b7e0 100644 --- a/auth/src/VSCodeAzureSubscriptionProvider.ts +++ b/auth/src/VSCodeAzureSubscriptionProvider.ts @@ -108,7 +108,7 @@ export class VSCodeAzureSubscriptionProvider extends vscode.Disposable implement } // If the user is not signed in to this tenant, then skip it - if (!(await this.isSignedIn(tenantId))) { + if (!(await this.isSignedIn(tenantId, account))) { continue; } @@ -140,8 +140,8 @@ export class VSCodeAzureSubscriptionProvider extends vscode.Disposable implement * * @returns True if the user is signed in, false otherwise. */ - public async isSignedIn(tenantId?: string): Promise { - const session = await getSessionFromVSCode([], tenantId, { createIfNone: false, silent: true }); + public async isSignedIn(tenantId?: string, account?: vscode.AuthenticationSessionAccountInformation): Promise { + const session = await getSessionFromVSCode([], tenantId, { createIfNone: false, silent: true, account }); return !!session; }