mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
refactored mainthreadauth with silent option and tests (#135503)
This commit is contained in:
committed by
GitHub
parent
fb0e4870b3
commit
c71e201bed
@@ -226,12 +226,12 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
|
||||
const authentication: typeof vscode.authentication = {
|
||||
getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) {
|
||||
if (options?.forceNewSession) {
|
||||
if (options?.forceNewSession || options?.silent) {
|
||||
checkProposedApiEnabled(extension);
|
||||
}
|
||||
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
|
||||
},
|
||||
// TODO: optimize this API to only return the boolean over the wire
|
||||
// TODO: remove this after GHPR and Codespaces move off of it
|
||||
async hasSession(providerId: string, scopes: readonly string[]) {
|
||||
checkProposedApiEnabled(extension);
|
||||
return !!(await extHostAuthentication.getSession(extension, providerId, scopes, { solelyCheckExistence: true } as any));
|
||||
|
||||
Reference in New Issue
Block a user