From e0c8a76b7ad6ef4100656aaf7af7f64c67685f5d Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Thu, 27 May 2021 16:45:59 -0700 Subject: [PATCH] don't sort scope list. Fixes Microsoft/vscode-pull-request-github#2751 --- extensions/github-authentication/src/github.ts | 2 +- .../services/authentication/browser/authenticationService.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/github-authentication/src/github.ts b/extensions/github-authentication/src/github.ts index 91dd54653a9..fa676744079 100644 --- a/extensions/github-authentication/src/github.ts +++ b/extensions/github-authentication/src/github.ts @@ -198,7 +198,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid */ this.telemetryReporter?.sendTelemetryEvent('login'); - const token = await this._githubServer.login(scopes.sort().join(' ')); + const token = await this._githubServer.login(scopes.join(' ')); this.afterTokenLoad(token); const session = await this.tokenToSession(token, scopes); await this.setToken(session); diff --git a/src/vs/workbench/services/authentication/browser/authenticationService.ts b/src/vs/workbench/services/authentication/browser/authenticationService.ts index b5da23219ea..2d938765cd1 100644 --- a/src/vs/workbench/services/authentication/browser/authenticationService.ts +++ b/src/vs/workbench/services/authentication/browser/authenticationService.ts @@ -338,7 +338,7 @@ export class AuthenticationService extends Disposable implements IAuthentication } Object.keys(existingRequestsForProvider).forEach(requestedScopes => { - if (addedSessions.some(session => session.scopes.slice().sort().join('') === requestedScopes)) { + if (addedSessions.some(session => session.scopes.slice().join('') === requestedScopes)) { const sessionRequest = existingRequestsForProvider[requestedScopes]; sessionRequest?.disposables.forEach(item => item.dispose()); @@ -604,7 +604,7 @@ export class AuthenticationService extends Disposable implements IAuthentication if (provider) { const providerRequests = this._signInRequestItems.get(providerId); - const scopesList = scopes.sort().join(''); + const scopesList = scopes.join(''); const extensionHasExistingRequest = providerRequests && providerRequests[scopesList] && providerRequests[scopesList].requestingExtensionIds.includes(extensionId);