Skip to content

Commit

Permalink
Add account parameter to isSignedIn (#1819)
Browse files Browse the repository at this point in the history
* auth: Add account parameter to isSignedIn
  • Loading branch information
alexweininger authored Nov 19, 2024
1 parent 159ee98 commit 0ecfad7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auth/src/AzureSubscriptionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface AzureSubscriptionProvider {
*
* @returns True if the user is signed in, false otherwise.
*/
isSignedIn(tenantId?: string): Promise<boolean>;
isSignedIn(tenantId?: string, account?: vscode.AuthenticationSessionAccountInformation): Promise<boolean>;

/**
* Asks the user to sign in or pick an account to use.
Expand Down
6 changes: 3 additions & 3 deletions auth/src/VSCodeAzureSubscriptionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<boolean> {
const session = await getSessionFromVSCode([], tenantId, { createIfNone: false, silent: true });
public async isSignedIn(tenantId?: string, account?: vscode.AuthenticationSessionAccountInformation): Promise<boolean> {
const session = await getSessionFromVSCode([], tenantId, { createIfNone: false, silent: true, account });
return !!session;
}

Expand Down

0 comments on commit 0ecfad7

Please sign in to comment.