Bug fix: check account id not session id (#206990)

This should be checking the account id not the session id... otherwise the user will get a modal every time they go through the login flow.
This commit is contained in:
Tyler James Leonhardt
2024-03-06 10:02:46 -08:00
committed by GitHub
parent b37060a43a
commit cd6bd0a01a

View File

@@ -304,11 +304,11 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
const session = await this.tokenToSession(token, scopes);
this.afterSessionLoad(session);
if (sessions.some(s => s.id !== session.id)) {
if (sessions.some(s => s.account.id !== session.account.id)) {
const otherAccountsIndexes = new Array<number>();
const otherAccountsLabels = new Set<string>();
for (let i = 0; i < sessions.length; i++) {
if (sessions[i].id !== session.id) {
if (sessions[i].account.id !== session.account.id) {
otherAccountsIndexes.push(i);
otherAccountsLabels.add(sessions[i].account.label);
}