From 68b91089db3d1e6ee52e958ee179f360ce3eb278 Mon Sep 17 00:00:00 2001 From: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com> Date: Fri, 28 Oct 2022 22:41:59 -0700 Subject: [PATCH] Fix population of username/password on loading saved profile (#21039) --- .../services/connection/browser/connectionWidget.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/services/connection/browser/connectionWidget.ts b/src/sql/workbench/services/connection/browser/connectionWidget.ts index dc07a4696d..8b3fd599d4 100644 --- a/src/sql/workbench/services/connection/browser/connectionWidget.ts +++ b/src/sql/workbench/services/connection/browser/connectionWidget.ts @@ -531,8 +531,12 @@ export class ConnectionWidget extends lifecycle.Disposable { protected onAuthTypeSelected(selectedAuthType: string) { let currentAuthType = this.getMatchingAuthType(selectedAuthType); - this._userNameInputBox.value = ''; - this._passwordInputBox.value = ''; + if (currentAuthType !== AuthenticationType.SqlLogin) { + if (currentAuthType !== AuthenticationType.AzureMFA && currentAuthType !== AuthenticationType.AzureMFAAndUser) { + this._userNameInputBox.value = ''; + } + this._passwordInputBox.value = ''; + } this._userNameInputBox.hideMessage(); this._passwordInputBox.hideMessage(); this._azureAccountDropdown.hideMessage();