Polish onDidChangePassword changes

This commit is contained in:
Rachel Macfarlane
2020-10-12 10:31:00 -07:00
parent 9910c38005
commit 31419adc34
9 changed files with 15 additions and 22 deletions

View File

@@ -93,10 +93,11 @@ export class AzureActiveDirectoryService {
private _tokens: IToken[] = [];
private _refreshTimeouts: Map<string, NodeJS.Timeout> = new Map<string, NodeJS.Timeout>();
private _uriHandler: UriEventHandler;
private _disposables: vscode.Disposable[] = [];
constructor() {
this._uriHandler = new UriEventHandler();
vscode.window.registerUriHandler(this._uriHandler);
this._disposables.push(vscode.window.registerUriHandler(this._uriHandler));
}
public async initialize(): Promise<void> {
@@ -140,7 +141,7 @@ export class AzureActiveDirectoryService {
}
}
keychain.onDidChangePassword(() => this.checkForUpdates);
this._disposables.push(vscode.authentication.onDidChangePassword(() => this.checkForUpdates));
}
private parseStoredData(data: string): IStoredSession[] {
@@ -340,6 +341,11 @@ export class AzureActiveDirectoryService {
});
}
public dispose(): void {
this._disposables.forEach(disposable => disposable.dispose());
this._disposables = [];
}
private getCallbackEnvironment(callbackUri: vscode.Uri): string {
if (callbackUri.authority.endsWith('.workspaces.github.com') || callbackUri.authority.endsWith('.github.dev')) {
return `${callbackUri.authority},`;