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 @@ -1757,7 +1757,7 @@ async function asyncServerForUri(uri: vscode.Uri): Promise<any> {
1757
1757
return server ;
1758
1758
}
1759
1759
1760
- export function deactivate ( ) : void {
1760
+ export async function deactivate ( ) : Promise < void > {
1761
1761
if ( workspaceState ) {
1762
1762
workspaceState . update ( "openedClasses" , openedClasses ) ;
1763
1763
}
@@ -1770,4 +1770,25 @@ export function deactivate(): void {
1770
1770
incLangConf ?. dispose ( ) ;
1771
1771
intLangConf ?. dispose ( ) ;
1772
1772
disposeDocumentIndex ( ) ;
1773
+ // Log out of all CSP sessions
1774
+ const loggedOut : Set < string > = new Set ( ) ;
1775
+ const promises : Promise < any > [ ] = [ ] ;
1776
+ for ( const f of vscode . workspace . workspaceFolders ?? [ ] ) {
1777
+ const api = new AtelierAPI ( f . uri ) ;
1778
+ if ( ! api . active || ! api . cookies . length ) continue ;
1779
+ const sessionCookie = api . cookies . find ( ( c ) => c . startsWith ( "CSPSESSIONID-" ) ) ;
1780
+ if ( ! sessionCookie || loggedOut . has ( sessionCookie ) ) continue ;
1781
+ loggedOut . add ( sessionCookie ) ;
1782
+ promises . push (
1783
+ api . request (
1784
+ 0 ,
1785
+ "HEAD" ,
1786
+ undefined ,
1787
+ undefined ,
1788
+ // Prefer IRISLogout for servers that support it
1789
+ semver . lt ( api . config . serverVersion , "2018.2.0" ) ? { CacheLogout : "end" } : { IRISLogout : "end" }
1790
+ )
1791
+ ) ;
1792
+ }
1793
+ await Promise . allSettled ( promises ) ;
1773
1794
}
You can’t perform that action at this time.
0 commit comments