mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 17:23:19 -05:00
Fix missing password in Connection pane for Server connections with remembered passwords (#21813)
* Fix missing password in Connection pane * Get saved password for SQL login default auth type * Clean up * Fix build hygiene errors * Captures input * Add timeout waiting for all promises to resolve * Add missing semicolon * Code review feedback * Minor clean up * Code review feedback * Improved error messaging * Update src/sql/workbench/services/connection/browser/connectionDialogService.ts Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Improves UX around loading passwords * Remove unused import * Uses await instead of promise chaining. * Removes async * Revert back to resolving password promise. * Asserts controller map and model have values. --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -44,6 +44,7 @@ import { createCSSRule } from 'vs/base/browser/dom';
|
||||
const ConnectionStringText = localize('connectionWidget.connectionString', "Connection string");
|
||||
|
||||
export class ConnectionWidget extends lifecycle.Disposable {
|
||||
private _initialConnectionInfo: IConnectionProfile;
|
||||
private _defaultInputOptionRadioButton: RadioButton;
|
||||
private _connectionStringRadioButton: RadioButton;
|
||||
private _previousGroupOption: string;
|
||||
@@ -612,7 +613,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
this._callbacks.onSetConnectButton(shouldEnableConnectButton);
|
||||
}
|
||||
|
||||
protected onAuthTypeSelected(selectedAuthType: string) {
|
||||
protected onAuthTypeSelected(selectedAuthType: string): void {
|
||||
let currentAuthType = this.getMatchingAuthType(selectedAuthType);
|
||||
if (currentAuthType !== AuthenticationType.SqlLogin) {
|
||||
if (currentAuthType !== AuthenticationType.AzureMFA && currentAuthType !== AuthenticationType.AzureMFAAndUser) {
|
||||
@@ -668,6 +669,16 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
this._userNameInputBox.enable();
|
||||
this._passwordInputBox.enable();
|
||||
this._rememberPasswordCheckBox.enabled = true;
|
||||
|
||||
this._initialConnectionInfo.authenticationType = AuthenticationType.SqlLogin;
|
||||
if (this._initialConnectionInfo && this._initialConnectionInfo.userName) {
|
||||
const setPasswordInputBox = (profile: IConnectionProfile) => {
|
||||
this._passwordInputBox.value = profile.password;
|
||||
};
|
||||
|
||||
this._rememberPasswordCheckBox.checked = this._initialConnectionInfo.savePassword;
|
||||
this._connectionManagementService.addSavedPassword(this._initialConnectionInfo, true).then(setPasswordInputBox)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -822,6 +833,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
}
|
||||
|
||||
public initDialog(connectionInfo: IConnectionProfile): void {
|
||||
this._initialConnectionInfo = connectionInfo;
|
||||
this.fillInConnectionInputs(connectionInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user