Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/authenticationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { ServerManagerAuthenticationSession } from "./authenticationSession";
import { globalState } from "./commonActivate";
import { getServerSpec } from "./api/getServerSpec";
import { makeRESTRequest } from "./makeRESTRequest";
import { logout, makeRESTRequest } from "./makeRESTRequest";

export const AUTHENTICATION_PROVIDER = "intersystems-server-credentials";
const AUTHENTICATION_PROVIDER_LABEL = "InterSystems Server Credentials";
Expand Down Expand Up @@ -230,6 +230,8 @@ export class ServerManagerAuthenticationProvider implements AuthenticationProvid
await this._removeSession(session.id, true);
return false;
}
// Immediately log out the session created by credentials test
await logout(session.serverName);
}
this._checkedSessions.push(session);
return true;
Expand Down
8 changes: 7 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as vscode from "vscode";
import { importFromRegistry } from "./commands/importFromRegistry";
import { ServerManagerView } from "./ui/serverManagerView";
import { commonActivate, extensionId } from "./commonActivate";
import { logout, serverSessions } from "./makeRESTRequest";

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

export function deactivate() { }
export async function deactivate() {
// Do our best to log out of all sessions
Comment thread
isc-bsaviano marked this conversation as resolved.
for (const serverSession of serverSessions) {
Comment thread
isc-bsaviano marked this conversation as resolved.
await logout(serverSession[1].serverName);
}
}