Make scopes parameter optional to getSessions and remove getAllSessions

This commit is contained in:
Rachel Macfarlane
2021-02-12 09:05:31 -08:00
parent a16f5d2c4c
commit 14669c2e45
13 changed files with 27 additions and 51 deletions

View File

@@ -44,8 +44,10 @@ export class GitHubAuthenticationProvider {
context.subscriptions.push(context.secrets.onDidChange(() => this.checkForUpdates()));
}
async getSessions(scopes: string[]): Promise<vscode.AuthenticationSession[]> {
return this._sessions.filter(session => arrayEquals(session.scopes, scopes));
async getSessions(scopes?: string[]): Promise<vscode.AuthenticationSession[]> {
return scopes
? this._sessions.filter(session => arrayEquals(session.scopes, scopes))
: this._sessions;
}
private async verifySessions(): Promise<void> {