diff --git a/packages/core/src/models/constants.ts b/packages/core/src/models/constants.ts index f36698bfc..6007ac79a 100644 --- a/packages/core/src/models/constants.ts +++ b/packages/core/src/models/constants.ts @@ -19,7 +19,7 @@ export const constants = { timeout: 10000, credentialsDestination: ".aws/credentials", defaultRegion: "us-east-1", - maxSsoTps: 10, // Transaction per second for AWS SSO endpoint + maxSsoTps: 5, // Transaction per second for AWS SSO endpoint //Azure azureMsalCacheFile: ".azure/msal_token_cache.json", diff --git a/packages/core/src/services/integration/aws-sso-integration-service.ts b/packages/core/src/services/integration/aws-sso-integration-service.ts index 08f85bd58..3fa579e82 100644 --- a/packages/core/src/services/integration/aws-sso-integration-service.ts +++ b/packages/core/src/services/integration/aws-sso-integration-service.ts @@ -180,21 +180,14 @@ export class AwsSsoIntegrationService implements IIntegrationService { // Make a logout request to Sso const logoutRequest: LogoutRequest = { accessToken: savedAccessToken }; - /*try { - await this.ssoPortal.logout(logoutRequest); - } catch (_) { - // logout request has to be handled in reject Promise by design - - // Clean clients - this.ssoPortal = null; - - // Delete access token and remove sso integration info from workspace - await this.keyChainService.deleteSecret(constants.appName, this.getIntegrationAccessTokenKey(integrationId)); - this.repository.unsetAwsSsoIntegrationExpiration(integrationId); - }*/ - if (savedAccessToken !== null) { - await this.ssoPortal.logout(logoutRequest); + try { + await this.ssoPortal.logout(logoutRequest); + } catch (error) { + if (!(error.message === "Session token not found or invalid")) { + throw error; + } + } } // Clean clients