From 3d66a4d2e05fdd96e914927b56889b475dc13624 Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Mon, 20 Oct 2025 07:04:45 -0400 Subject: [PATCH 1/2] Fix logic for invalidating a REST session --- src/authenticationProvider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/authenticationProvider.ts b/src/authenticationProvider.ts index 7ff0b68..bd0d519 100644 --- a/src/authenticationProvider.ts +++ b/src/authenticationProvider.ts @@ -225,7 +225,8 @@ export class ServerManagerAuthenticationProvider implements AuthenticationProvid serverSpec.username = session.userName; serverSpec.password = session.accessToken; const response = await makeRESTRequest("HEAD", serverSpec).catch(() => { /* Swallow errors */ }); - if (response?.status != 200) { + if ([undefined, 401].includes(response?.status)) { + // Session is only invalid if we get a 401 or there's an error await this._removeSession(session.id, true); return false; } From 9083fed94ae569748ca072da734ea514581d4c7a Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Mon, 20 Oct 2025 07:47:06 -0400 Subject: [PATCH 2/2] Update authenticationProvider.ts --- src/authenticationProvider.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/authenticationProvider.ts b/src/authenticationProvider.ts index bd0d519..31a8030 100644 --- a/src/authenticationProvider.ts +++ b/src/authenticationProvider.ts @@ -225,8 +225,7 @@ export class ServerManagerAuthenticationProvider implements AuthenticationProvid serverSpec.username = session.userName; serverSpec.password = session.accessToken; const response = await makeRESTRequest("HEAD", serverSpec).catch(() => { /* Swallow errors */ }); - if ([undefined, 401].includes(response?.status)) { - // Session is only invalid if we get a 401 or there's an error + if (response?.status == 401) { await this._removeSession(session.id, true); return false; }