Implement getAccounts API over getSessions (#215874)

And plumb that through to the Microsoft auth provider
This commit is contained in:
Tyler James Leonhardt
2024-06-16 18:12:37 -07:00
committed by GitHub
parent fc1a9a48ec
commit 5d7157cb03
12 changed files with 179 additions and 85 deletions

View File

@@ -287,12 +287,19 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
if (typeof options?.forceNewSession === 'object' && options.forceNewSession.learnMore) {
checkProposedApiEnabled(extension, 'authLearnMore');
}
if (options?.account) {
checkProposedApiEnabled(extension, 'authGetSessions');
}
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
},
getSessions(providerId: string, scopes: readonly string[]) {
checkProposedApiEnabled(extension, 'authGetSessions');
return extHostAuthentication.getSessions(extension, providerId, scopes);
},
getAccounts(providerId: string) {
checkProposedApiEnabled(extension, 'authGetSessions');
return extHostAuthentication.getAccounts(providerId);
},
// TODO: remove this after GHPR and Codespaces move off of it
async hasSession(providerId: string, scopes: readonly string[]) {
checkProposedApiEnabled(extension, 'authSession');