mirror of
https://github.com/coder/code-server.git
synced 2025-07-31 22:13:52 +08:00
chore(vscode): update to 1.54.2
This commit is contained in:
@ -14,7 +14,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
const telemetryReporter = new TelemetryReporter(name, version, aiKey);
|
||||
|
||||
context.subscriptions.push(vscode.window.registerUriHandler(uriHandler));
|
||||
const loginService = new GitHubAuthenticationProvider(context);
|
||||
const loginService = new GitHubAuthenticationProvider(context, telemetryReporter);
|
||||
|
||||
await loginService.initialize(context);
|
||||
|
||||
@ -24,17 +24,17 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
context.subscriptions.push(vscode.authentication.registerAuthenticationProvider('github', 'GitHub', {
|
||||
onDidChangeSessions: onDidChangeSessions.event,
|
||||
getSessions: () => Promise.resolve(loginService.sessions),
|
||||
login: async (scopeList: string[]) => {
|
||||
getSessions: (scopes?: string[]) => loginService.getSessions(scopes),
|
||||
createSession: async (scopeList: string[]) => {
|
||||
try {
|
||||
/* __GDPR__
|
||||
"login" : { }
|
||||
*/
|
||||
telemetryReporter.sendTelemetryEvent('login');
|
||||
|
||||
const session = await loginService.login(scopeList.sort().join(' '));
|
||||
const session = await loginService.createSession(scopeList.sort().join(' '));
|
||||
Logger.info('Login success!');
|
||||
onDidChangeSessions.fire({ added: [session.id], removed: [], changed: [] });
|
||||
onDidChangeSessions.fire({ added: [session], removed: [], changed: [] });
|
||||
return session;
|
||||
} catch (e) {
|
||||
// If login was cancelled, do not notify user.
|
||||
@ -56,15 +56,17 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
logout: async (id: string) => {
|
||||
removeSession: async (id: string) => {
|
||||
try {
|
||||
/* __GDPR__
|
||||
"logout" : { }
|
||||
*/
|
||||
telemetryReporter.sendTelemetryEvent('logout');
|
||||
|
||||
await loginService.logout(id);
|
||||
onDidChangeSessions.fire({ added: [], removed: [id], changed: [] });
|
||||
const session = await loginService.removeSession(id);
|
||||
if (session) {
|
||||
onDidChangeSessions.fire({ added: [], removed: [session], changed: [] });
|
||||
}
|
||||
} catch (e) {
|
||||
/* __GDPR__
|
||||
"logoutFailed" : { }
|
||||
|
Reference in New Issue
Block a user