Skip to content

Commit 3bdea77

Browse files
authored
authentication implicit activation events (microsoft#166715)
* `authentication` implicit activation events * More safety accessing `.id`
1 parent 63f8550 commit 3bdea77

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

extensions/github-authentication/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
"ui",
1818
"workspace"
1919
],
20-
"activationEvents": [
21-
"onAuthenticationRequest:github",
22-
"onAuthenticationRequest:github-enterprise"
23-
],
20+
"activationEvents": [],
2421
"capabilities": {
2522
"virtualWorkspaces": true,
2623
"untrustedWorkspaces": {

extensions/microsoft-authentication/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
"categories": [
1313
"Other"
1414
],
15-
"activationEvents": [
16-
"onAuthenticationRequest:microsoft"
17-
],
15+
"activationEvents": [],
1816
"enabledApiProposals": [
1917
"telemetryLogger",
2018
"idToken"

src/vs/workbench/services/authentication/browser/authenticationService.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ const authenticationExtPoint = ExtensionsRegistry.registerExtensionPoint<Authent
152152
description: nls.localize({ key: 'authenticationExtensionPoint', comment: [`'Contributes' means adds here`] }, 'Contributes authentication'),
153153
type: 'array',
154154
items: authenticationDefinitionSchema
155+
},
156+
activationEventsGenerator: (authenticationProviders, result) => {
157+
for (const authenticationProvider of authenticationProviders) {
158+
if (authenticationProvider.id) {
159+
result.push(`onAuthenticationRequest:${authenticationProvider.id}`);
160+
}
161+
}
155162
}
156163
});
157164

0 commit comments

Comments
 (0)