mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Skip fetching access token when opening context menu in OE (#21557)
This commit is contained in:
@@ -202,7 +202,7 @@ export interface IConnectionManagementService {
|
|||||||
|
|
||||||
disconnect(ownerUri: string): Promise<void>;
|
disconnect(ownerUri: string): Promise<void>;
|
||||||
|
|
||||||
addSavedPassword(connectionProfile: IConnectionProfile): Promise<IConnectionProfile>;
|
addSavedPassword(connectionProfile: IConnectionProfile, skipAccessToken?: boolean): Promise<IConnectionProfile>;
|
||||||
|
|
||||||
listDatabases(connectionUri: string): Thenable<azdata.ListDatabasesResult | undefined>;
|
listDatabases(connectionUri: string): Thenable<azdata.ListDatabasesResult | undefined>;
|
||||||
|
|
||||||
|
|||||||
@@ -255,8 +255,10 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
* Load the password for the profile
|
* Load the password for the profile
|
||||||
* @param connectionProfile Connection Profile
|
* @param connectionProfile Connection Profile
|
||||||
*/
|
*/
|
||||||
public async addSavedPassword(connectionProfile: interfaces.IConnectionProfile): Promise<interfaces.IConnectionProfile> {
|
public async addSavedPassword(connectionProfile: interfaces.IConnectionProfile, skipAccessToken: boolean = false): Promise<interfaces.IConnectionProfile> {
|
||||||
|
if (!skipAccessToken) {
|
||||||
await this.fillInOrClearToken(connectionProfile);
|
await this.fillInOrClearToken(connectionProfile);
|
||||||
|
}
|
||||||
return this._connectionStore.addSavedPassword(connectionProfile).then(result => result.profile);
|
return this._connectionStore.addSavedPassword(connectionProfile).then(result => result.profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ export class ServerTreeActionProvider {
|
|||||||
*/
|
*/
|
||||||
private getConnectionActions(tree: AsyncServerTree | ITree, profile: ConnectionProfile): IAction[] {
|
private getConnectionActions(tree: AsyncServerTree | ITree, profile: ConnectionProfile): IAction[] {
|
||||||
let node = new TreeNode(NodeType.Server, NodeType.Server, '', false, '', '', '', undefined, undefined, undefined, undefined);
|
let node = new TreeNode(NodeType.Server, NodeType.Server, '', false, '', '', '', undefined, undefined, undefined, undefined);
|
||||||
this._connectionManagementService.addSavedPassword(profile);
|
// Only update password and not access tokens to avoid login prompts when opening context menu.
|
||||||
|
this._connectionManagementService.addSavedPassword(profile, true);
|
||||||
node.connection = profile;
|
node.connection = profile;
|
||||||
return this.getAllActions({
|
return this.getAllActions({
|
||||||
tree: tree,
|
tree: tree,
|
||||||
|
|||||||
Reference in New Issue
Block a user