initial unoptimized hasSession API

This commit is contained in:
Tyler Leonhardt
2021-10-14 13:38:58 -07:00
parent 9e94461660
commit 684fff706a
3 changed files with 20 additions and 6 deletions

View File

@@ -231,6 +231,11 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
},
// TODO: optimize this API to only return the boolean over the wire
async hasSession(providerId: string, scopes: readonly string[]) {
checkProposedApiEnabled(extension);
return !!(await extHostAuthentication.getSession(extension, providerId, scopes, { solelyCheckExistence: true } as any));
},
get onDidChangeSessions(): Event<vscode.AuthenticationSessionsChangeEvent> {
return extHostAuthentication.onDidChangeSessions;
},