From 3bdea7784d6ef67722967a4cd51179b30e9a1013 Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Sat, 19 Nov 2022 08:30:48 -0800 Subject: [PATCH] `authentication` implicit activation events (#166715) * `authentication` implicit activation events * More safety accessing `.id` --- extensions/github-authentication/package.json | 5 +---- extensions/microsoft-authentication/package.json | 4 +--- .../authentication/browser/authenticationService.ts | 7 +++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/extensions/github-authentication/package.json b/extensions/github-authentication/package.json index 66ce1bd080b..cfe97094b49 100644 --- a/extensions/github-authentication/package.json +++ b/extensions/github-authentication/package.json @@ -17,10 +17,7 @@ "ui", "workspace" ], - "activationEvents": [ - "onAuthenticationRequest:github", - "onAuthenticationRequest:github-enterprise" - ], + "activationEvents": [], "capabilities": { "virtualWorkspaces": true, "untrustedWorkspaces": { diff --git a/extensions/microsoft-authentication/package.json b/extensions/microsoft-authentication/package.json index f3340fb307e..9a130e61ca8 100644 --- a/extensions/microsoft-authentication/package.json +++ b/extensions/microsoft-authentication/package.json @@ -12,9 +12,7 @@ "categories": [ "Other" ], - "activationEvents": [ - "onAuthenticationRequest:microsoft" - ], + "activationEvents": [], "enabledApiProposals": [ "telemetryLogger", "idToken" diff --git a/src/vs/workbench/services/authentication/browser/authenticationService.ts b/src/vs/workbench/services/authentication/browser/authenticationService.ts index 1d9ac762f1f..8dd6e19bb24 100644 --- a/src/vs/workbench/services/authentication/browser/authenticationService.ts +++ b/src/vs/workbench/services/authentication/browser/authenticationService.ts @@ -152,6 +152,13 @@ const authenticationExtPoint = ExtensionsRegistry.registerExtensionPoint { + for (const authenticationProvider of authenticationProviders) { + if (authenticationProvider.id) { + result.push(`onAuthenticationRequest:${authenticationProvider.id}`); + } + } } });