File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1783,7 +1783,7 @@ async function asyncServerForUri(uri: vscode.Uri): Promise<any> {
1783
1783
return server ;
1784
1784
}
1785
1785
1786
- export function deactivate ( ) : void {
1786
+ export async function deactivate ( ) : Promise < void > {
1787
1787
if ( workspaceState ) {
1788
1788
workspaceState . update ( "openedClasses" , openedClasses ) ;
1789
1789
}
@@ -1796,4 +1796,25 @@ export function deactivate(): void {
1796
1796
incLangConf ?. dispose ( ) ;
1797
1797
intLangConf ?. dispose ( ) ;
1798
1798
disposeDocumentIndex ( ) ;
1799
+ // Log out of all CSP sessions
1800
+ const loggedOut : Set < string > = new Set ( ) ;
1801
+ const promises : Promise < any > [ ] = [ ] ;
1802
+ for ( const f of vscode . workspace . workspaceFolders ?? [ ] ) {
1803
+ const api = new AtelierAPI ( f . uri ) ;
1804
+ if ( ! api . active || ! api . cookies . length ) continue ;
1805
+ const sessionCookie = api . cookies . find ( ( c ) => c . startsWith ( "CSPSESSIONID-" ) ) ;
1806
+ if ( ! sessionCookie || loggedOut . has ( sessionCookie ) ) continue ;
1807
+ loggedOut . add ( sessionCookie ) ;
1808
+ promises . push (
1809
+ api . request (
1810
+ 0 ,
1811
+ "HEAD" ,
1812
+ undefined ,
1813
+ undefined ,
1814
+ // Prefer IRISLogout for servers that support it
1815
+ semver . lt ( api . config . serverVersion , "2018.2.0" ) ? { CacheLogout : "end" } : { IRISLogout : "end" }
1816
+ )
1817
+ ) ;
1818
+ }
1819
+ await Promise . allSettled ( promises ) ;
1799
1820
}
You can’t perform that action at this time.
0 commit comments