@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.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -593,6 +593,8 @@ var Auth = class {
|
|
|
593
593
|
console.log("[InsForge:Auth] _detectStorageFromResponse() - sessionMode:", sessionMode);
|
|
594
594
|
if (sessionMode === "secure") {
|
|
595
595
|
this._switchToSecureStorage();
|
|
596
|
+
} else {
|
|
597
|
+
this._switchToLocalStorage();
|
|
596
598
|
}
|
|
597
599
|
}
|
|
598
600
|
/**
|
|
@@ -816,6 +818,12 @@ var Auth = class {
|
|
|
816
818
|
} catch (error) {
|
|
817
819
|
console.error("[InsForge:Auth] refreshToken() - error:", error);
|
|
818
820
|
if (error instanceof InsForgeError) {
|
|
821
|
+
if (error.statusCode === 404) {
|
|
822
|
+
console.log("[InsForge:Auth] refreshToken() - 404 detected, backend does not support refresh endpoint");
|
|
823
|
+
console.log("[InsForge:Auth] refreshToken() - switching to LocalSessionStorage for backward compatibility");
|
|
824
|
+
this._switchToLocalStorage();
|
|
825
|
+
this.clearAuthenticatedCookie();
|
|
826
|
+
}
|
|
819
827
|
if (error.statusCode === 401 || error.statusCode === 403) {
|
|
820
828
|
console.log("[InsForge:Auth] refreshToken() - clearing session due to 401/403");
|
|
821
829
|
this.tokenManager.clearSession();
|