@insforge/sdk 1.2.8-dev.2 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -669,7 +669,9 @@ var HttpClient = class {
669
669
  try {
670
670
  await this.refreshAndSaveSession();
671
671
  } catch (error2) {
672
- this.clearAuthSession();
672
+ if (error2 instanceof InsForgeError && (error2.statusCode === 401 || error2.statusCode === 403)) {
673
+ this.clearAuthSession();
674
+ }
673
675
  throw error2;
674
676
  }
675
677
  return await this.handleRequest(method, path, {
@@ -775,7 +777,9 @@ var HttpClient = class {
775
777
  try {
776
778
  newTokenData = await this.refreshAndSaveSession();
777
779
  } catch (error) {
778
- this.clearAuthSession();
780
+ if (error instanceof InsForgeError && (error.statusCode === 401 || error.statusCode === 403)) {
781
+ this.clearAuthSession();
782
+ }
779
783
  throw error;
780
784
  }
781
785
  const retryHeaders = new Headers(initHeaders);