mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-23 19:27:15 +00:00
make sure we splice the sessions if they have the same set of scopes for github authentication
This commit is contained in:
@@ -195,12 +195,13 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
|
||||
scopes: JSON.stringify(scopes),
|
||||
});
|
||||
|
||||
const token = await this._githubServer.login(scopes.join(' '));
|
||||
const scopeString = scopes.join(' ');
|
||||
const token = await this._githubServer.login(scopeString);
|
||||
this.afterTokenLoad(token);
|
||||
const session = await this.tokenToSession(token, scopes);
|
||||
|
||||
const sessions = await this._sessionsPromise;
|
||||
const sessionIndex = sessions.findIndex(s => s.id === session.id);
|
||||
const sessionIndex = sessions.findIndex(s => s.id === session.id || s.scopes.join(' ') === scopeString);
|
||||
if (sessionIndex > -1) {
|
||||
sessions.splice(sessionIndex, 1, session);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user