mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Fix username to respect existing values (#22837)
This commit is contained in:
@@ -669,7 +669,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
this._azureTenantDropdown.enable();
|
||||
// Populate username as 'email' of selected azure account in dropdown, as username is required,
|
||||
// and email of Azure account selected applies as username in most cases.
|
||||
this._userNameInputBox.value = this._azureAccountList.find(a => a.displayInfo.displayName === this._azureAccountDropdown.value)?.displayInfo.email!
|
||||
this._userNameInputBox.value = this.userName ?? this._azureAccountList.find(a => a.displayInfo.displayName === this._azureAccountDropdown.value)?.displayInfo.email!
|
||||
?? this._azureAccountList[0]?.displayInfo?.email ?? '';
|
||||
}).catch(err => this._logService.error(`Unexpected error populating Azure Account dropdown : ${err}`));
|
||||
// Immediately show/hide appropriate elements though so user gets immediate feedback while we load accounts
|
||||
@@ -783,7 +783,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
selectedAccount = this._azureAccountList[0];
|
||||
}
|
||||
|
||||
if (this.authenticationType === AuthenticationType.AzureMFAAndUser) {
|
||||
if (this.authenticationType === AuthenticationType.AzureMFAAndUser && this._userNameInputBox.value === '') {
|
||||
// Populate username as 'email' of selected azure account in dropdown, as username is required,
|
||||
// and email of Azure account selected applies as username in most cases.
|
||||
this._userNameInputBox.value = selectedAccount?.displayInfo?.email! ?? '';
|
||||
|
||||
Reference in New Issue
Block a user