Issue distinct sessions per extension, remove session when extension is removed from trusted list

This commit is contained in:
Rachel Macfarlane
2020-03-30 14:34:27 -07:00
parent fe48834db8
commit 85119afc7b
8 changed files with 97 additions and 18 deletions

View File

@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import * as uuid from 'uuid';
import { keychain } from './common/keychain';
import { GitHubServer } from './githubServer';
import Logger from './common/logger';
@@ -122,7 +123,7 @@ export class GitHubAuthenticationProvider {
private async tokenToSession(token: string, scopes: string[]): Promise<vscode.AuthenticationSession> {
const userInfo = await this._githubServer.getUserInfo(token);
return {
id: userInfo.id,
id: uuid(),
getAccessToken: () => Promise.resolve(token),
accountName: userInfo.accountName,
scopes: scopes