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 {
16
16
import { ServerManagerAuthenticationSession } from "./authenticationSession" ;
17
17
import { globalState } from "./commonActivate" ;
18
18
import { getServerSpec } from "./api/getServerSpec" ;
19
- import { makeRESTRequest } from "./makeRESTRequest" ;
19
+ import { logout , makeRESTRequest } from "./makeRESTRequest" ;
20
20
21
21
export const AUTHENTICATION_PROVIDER = "intersystems-server-credentials" ;
22
22
const AUTHENTICATION_PROVIDER_LABEL = "InterSystems Server Credentials" ;
@@ -230,6 +230,8 @@ export class ServerManagerAuthenticationProvider implements AuthenticationProvid
230
230
await this . _removeSession ( session . id , true ) ;
231
231
return false ;
232
232
}
233
+ // Immediately log out the session created by credentials test
234
+ await logout ( session . serverName ) ;
233
235
}
234
236
this . _checkedSessions . push ( session ) ;
235
237
return true ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as vscode from "vscode";
4
4
import { importFromRegistry } from "./commands/importFromRegistry" ;
5
5
import { ServerManagerView } from "./ui/serverManagerView" ;
6
6
import { commonActivate , extensionId } from "./commonActivate" ;
7
+ import { logout , serverSessions } from "./makeRESTRequest" ;
7
8
8
9
export function activate ( context : vscode . ExtensionContext ) {
9
10
const view = new ServerManagerView ( context ) ;
@@ -20,4 +21,12 @@ export function activate(context: vscode.ExtensionContext) {
20
21
return commonActivate ( context , view ) ;
21
22
}
22
23
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 3
3
import * as vscode from "vscode" ;
4
4
import { ServerManagerView } from "./ui/serverManagerView" ;
5
5
import { commonActivate } from "./commonActivate" ;
6
+ import { logout , serverSessions } from "./makeRESTRequest" ;
6
7
7
8
export function activate ( context : vscode . ExtensionContext ) {
8
- const view = new ServerManagerView ( context ) ;
9
+ const view = new ServerManagerView ( context ) ;
9
10
10
- // Common activation steps
11
- return commonActivate ( context , view ) ;
11
+ // Common activation steps
12
+ return commonActivate ( context , view ) ;
12
13
}
13
14
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