@insforge/sdk 1.0.1-refresh.6 → 1.0.1-refresh.7

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
@@ -554,6 +554,8 @@ var Auth = class {
554
554
  console.log("[InsForge:Auth] _detectStorageFromResponse() - sessionMode:", sessionMode);
555
555
  if (sessionMode === "secure") {
556
556
  this._switchToSecureStorage();
557
+ } else {
558
+ this._switchToLocalStorage();
557
559
  }
558
560
  }
559
561
  /**
@@ -777,6 +779,12 @@ var Auth = class {
777
779
  } catch (error) {
778
780
  console.error("[InsForge:Auth] refreshToken() - error:", error);
779
781
  if (error instanceof InsForgeError) {
782
+ if (error.statusCode === 404) {
783
+ console.log("[InsForge:Auth] refreshToken() - 404 detected, backend does not support refresh endpoint");
784
+ console.log("[InsForge:Auth] refreshToken() - switching to LocalSessionStorage for backward compatibility");
785
+ this._switchToLocalStorage();
786
+ this.clearAuthenticatedCookie();
787
+ }
780
788
  if (error.statusCode === 401 || error.statusCode === 403) {
781
789
  console.log("[InsForge:Auth] refreshToken() - clearing session due to 401/403");
782
790
  this.tokenManager.clearSession();