Show sign in entry for all auth providers in accounts menu, fixes #94488

This commit is contained in:
Rachel Macfarlane
2020-04-13 14:08:22 -07:00
parent 59e4b4562f
commit 061f4967f9
7 changed files with 61 additions and 60 deletions

View File

@@ -18,11 +18,13 @@ export async function activate(context: vscode.ExtensionContext) {
vscode.authentication.registerAuthenticationProvider({
id: 'github',
displayName: 'GitHub',
supportsMultipleAccounts: false,
onDidChangeSessions: onDidChangeSessions.event,
getSessions: () => Promise.resolve(loginService.sessions),
login: async (scopeList: string[]) => {
login: async (scopeList: string[] | undefined) => {
try {
const session = await loginService.login(scopeList.join(' '));
const loginScopes = scopeList ? scopeList.sort().join(' ') : 'user:email';
const session = await loginService.login(loginScopes);
Logger.info('Login success!');
onDidChangeSessions.fire({ added: [session.id], removed: [], changed: [] });
return session;