Skip to content

Commit 3a9f36e

Browse files
committed
Try to end /api/atelier web sessions when extension deactivates
1 parent ab32e85 commit 3a9f36e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/extension.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as vscode from "vscode";
44
import { importFromRegistry } from "./commands/importFromRegistry";
55
import { ServerManagerView } from "./ui/serverManagerView";
66
import { commonActivate, extensionId } from "./commonActivate";
7+
import { logout, serverSessions } from "./makeRESTRequest";
78

89
export function activate(context: vscode.ExtensionContext) {
910
const view = new ServerManagerView(context);
@@ -20,4 +21,9 @@ export function activate(context: vscode.ExtensionContext) {
2021
return commonActivate(context, view);
2122
}
2223

23-
export function deactivate() { }
24+
export async function deactivate() {
25+
// Do our best to log out of all sessions
26+
for (const serverSession of serverSessions) {
27+
await logout(serverSession[1].serverName);
28+
}
29+
}

0 commit comments

Comments
 (0)