mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fixes clearing of username/password on auth type change (#22138)
This commit is contained in:
@@ -130,7 +130,7 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
|||||||
this.fillInConnectionForm(authTypeChanged);
|
this.fillInConnectionForm(authTypeChanged);
|
||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
if (this._authTypeSelectBox) {
|
if (this._authTypeSelectBox) {
|
||||||
this.onAuthTypeSelected(this._authTypeSelectBox.value);
|
this.onAuthTypeSelected(this._authTypeSelectBox.value, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
this.fillInConnectionForm(authTypeChanged);
|
this.fillInConnectionForm(authTypeChanged);
|
||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
if (this._authTypeSelectBox) {
|
if (this._authTypeSelectBox) {
|
||||||
this.onAuthTypeSelected(this._authTypeSelectBox.value);
|
this.onAuthTypeSelected(this._authTypeSelectBox.value, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,7 +553,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
// Theme styler
|
// Theme styler
|
||||||
this._register(styler.attachSelectBoxStyler(this._authTypeSelectBox, this._themeService));
|
this._register(styler.attachSelectBoxStyler(this._authTypeSelectBox, this._themeService));
|
||||||
this._register(this._authTypeSelectBox.onDidSelect(selectedAuthType => {
|
this._register(this._authTypeSelectBox.onDidSelect(selectedAuthType => {
|
||||||
this.onAuthTypeSelected(selectedAuthType.selected);
|
this.onAuthTypeSelected(selectedAuthType.selected, true);
|
||||||
this.setConnectButton();
|
this.setConnectButton();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -613,12 +613,10 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
this._callbacks.onSetConnectButton(shouldEnableConnectButton);
|
this._callbacks.onSetConnectButton(shouldEnableConnectButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onAuthTypeSelected(selectedAuthType: string): void {
|
protected onAuthTypeSelected(selectedAuthType: string, clearCredentials: boolean): void {
|
||||||
let currentAuthType = this.getMatchingAuthType(selectedAuthType);
|
let currentAuthType = this.getMatchingAuthType(selectedAuthType);
|
||||||
if (currentAuthType !== AuthenticationType.SqlLogin) {
|
if (clearCredentials) {
|
||||||
if (currentAuthType !== AuthenticationType.AzureMFA && currentAuthType !== AuthenticationType.AzureMFAAndUser) {
|
this._userNameInputBox.value = '';
|
||||||
this._userNameInputBox.value = '';
|
|
||||||
}
|
|
||||||
this._passwordInputBox.value = '';
|
this._passwordInputBox.value = '';
|
||||||
}
|
}
|
||||||
this._userNameInputBox.hideMessage();
|
this._userNameInputBox.hideMessage();
|
||||||
@@ -915,7 +913,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this._authTypeSelectBox) {
|
if (this._authTypeSelectBox) {
|
||||||
this.onAuthTypeSelected(this._authTypeSelectBox.value);
|
this.onAuthTypeSelected(this._authTypeSelectBox.value, false);
|
||||||
} else {
|
} else {
|
||||||
this._tableContainer.classList.remove('hide-username');
|
this._tableContainer.classList.remove('hide-username');
|
||||||
this._tableContainer.classList.remove('hide-password');
|
this._tableContainer.classList.remove('hide-password');
|
||||||
|
|||||||
Reference in New Issue
Block a user