File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
1616import { ServerManagerAuthenticationSession } from "./authenticationSession" ;
1717import { globalState } from "./commonActivate" ;
1818import { getServerSpec } from "./api/getServerSpec" ;
19- import { makeRESTRequest } from "./makeRESTRequest" ;
19+ import { logout , makeRESTRequest } from "./makeRESTRequest" ;
2020
2121export const AUTHENTICATION_PROVIDER = "intersystems-server-credentials" ;
2222const AUTHENTICATION_PROVIDER_LABEL = "InterSystems Server Credentials" ;
@@ -230,6 +230,8 @@ export class ServerManagerAuthenticationProvider implements AuthenticationProvid
230230 await this . _removeSession ( session . id , true ) ;
231231 return false ;
232232 }
233+ // Immediately log out the session created by credentials test
234+ await logout ( session . serverName ) ;
233235 }
234236 this . _checkedSessions . push ( session ) ;
235237 return true ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as vscode from "vscode";
44import { importFromRegistry } from "./commands/importFromRegistry" ;
55import { ServerManagerView } from "./ui/serverManagerView" ;
66import { commonActivate , extensionId } from "./commonActivate" ;
7+ import { logout , serverSessions } from "./makeRESTRequest" ;
78
89export function activate ( context : vscode . ExtensionContext ) {
910 const view = new ServerManagerView ( context ) ;
@@ -20,4 +21,12 @@ 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+
27+ const promises : Promise < any > [ ] = [ ] ;
28+ for ( const serverSession of serverSessions ) {
29+ promises . push ( logout ( serverSession [ 1 ] . serverName ) ) ;
30+ }
31+ await Promise . allSettled ( promises ) ;
32+ }
Original file line number Diff line number Diff line change 33import * as vscode from "vscode" ;
44import { ServerManagerView } from "./ui/serverManagerView" ;
55import { commonActivate } from "./commonActivate" ;
6+ import { logout , serverSessions } from "./makeRESTRequest" ;
67
78export function activate ( context : vscode . ExtensionContext ) {
8- const view = new ServerManagerView ( context ) ;
9+ const view = new ServerManagerView ( context ) ;
910
10- // Common activation steps
11- return commonActivate ( context , view ) ;
11+ // Common activation steps
12+ return commonActivate ( context , view ) ;
1213}
1314
14- export function deactivate ( ) { }
15+ export async function deactivate ( ) {
16+ // Do our best to log out of all sessions
17+
18+ const promises : Promise < any > [ ] = [ ] ;
19+ for ( const serverSession of serverSessions ) {
20+ promises . push ( logout ( serverSession [ 1 ] . serverName ) ) ;
21+ }
22+ await Promise . allSettled ( promises ) ;
23+ }
You can’t perform that action at this time.
0 commit comments