diff --git a/src/commands/registerCommands.ts b/src/commands/registerCommands.ts index 8bc573a2..6436b10a 100644 --- a/src/commands/registerCommands.ts +++ b/src/commands/registerCommands.ts @@ -5,7 +5,7 @@ import { signInToTenant } from '@microsoft/vscode-azext-azureauth'; import { AzExtTreeItem, IActionContext, isAzExtTreeItem, openUrl, registerCommand, registerErrorHandler, registerReportIssueCommand } from '@microsoft/vscode-azext-utils'; -import { AuthenticationSessionAccountInformation, commands } from 'vscode'; +import { commands } from 'vscode'; import { uploadFileToCloudShell } from '../cloudConsole/uploadFileToCloudShell'; import { ext } from '../extensionVariables'; import { BranchDataItemWrapper } from '../tree/BranchDataItemWrapper'; @@ -70,8 +70,8 @@ export function registerCommands(): void { ext.actions.refreshTenantTree(node); }); - registerCommand('azureTenantsView.signInToTenant', async (_context, node: TenantTreeItem, account?: AuthenticationSessionAccountInformation) => { - await (await ext.subscriptionProviderFactory()).signIn(node.tenantId, account); + registerCommand('azureTenantsView.signInToTenant', async (_context, node: TenantTreeItem) => { + await (await ext.subscriptionProviderFactory()).signIn(node.tenantId, node.account); ext.actions.refreshTenantTree(node); }); diff --git a/src/tree/tenants/registerTenantTree.ts b/src/tree/tenants/registerTenantTree.ts index db118e90..61b39e3a 100644 --- a/src/tree/tenants/registerTenantTree.ts +++ b/src/tree/tenants/registerTenantTree.ts @@ -60,7 +60,7 @@ async function updateTenantsSetting(_context: IActionContext, tenants: vscode.Tr } else if (state === vscode.TreeItemCheckboxState.Checked) { const treeItem = await tenantTreeItem.getTreeItem(); if (treeItem?.contextValue === 'tenantNameNotSignedIn') { - await vscode.commands.executeCommand('azureTenantsView.signInToTenant', tenantTreeItem, tenantTreeItem.account); + await vscode.commands.executeCommand('azureTenantsView.signInToTenant', tenantTreeItem); ext.actions.refreshTenantTree(); } unselectedTenantsSet.delete(getKeyForTenant(tenantTreeItem.tenantId, tenantTreeItem.account.id));