mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
make sure we splice the sessions if they have the same set of scopes for github authentication
This commit is contained in:
parent
0756643874
commit
ab184912e6
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue