@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.mjs CHANGED
@@ -628,7 +628,9 @@ var HttpClient = class {
628
628
  try {
629
629
  await this.refreshAndSaveSession();
630
630
  } catch (error2) {
631
- this.clearAuthSession();
631
+ if (error2 instanceof InsForgeError && (error2.statusCode === 401 || error2.statusCode === 403)) {
632
+ this.clearAuthSession();
633
+ }
632
634
  throw error2;
633
635
  }
634
636
  return await this.handleRequest(method, path, {
@@ -734,7 +736,9 @@ var HttpClient = class {
734
736
  try {
735
737
  newTokenData = await this.refreshAndSaveSession();
736
738
  } catch (error) {
737
- this.clearAuthSession();
739
+ if (error instanceof InsForgeError && (error.statusCode === 401 || error.statusCode === 403)) {
740
+ this.clearAuthSession();
741
+ }
738
742
  throw error;
739
743
  }
740
744
  const retryHeaders = new Headers(initHeaders);