@getsoren/shared-module 2.51.1 → 2.52.0
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/hooks/tests/useAuth.test.d.ts +1 -0
- package/dist/main.js +11 -3
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/main.js
CHANGED
|
@@ -562,8 +562,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
562
562
|
return o(() => {
|
|
563
563
|
if (I) return;
|
|
564
564
|
let e = ({ newValue: e, key: t }) => {
|
|
565
|
-
if (t === s
|
|
566
|
-
let { accessToken: t, tokenType: n } = JSON.parse(e);
|
|
565
|
+
if (t === s) try {
|
|
566
|
+
let { accessToken: t, tokenType: n } = JSON.parse(e ?? "null") ?? {};
|
|
567
|
+
if (!t) {
|
|
568
|
+
l();
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
567
571
|
c({
|
|
568
572
|
accessToken: t,
|
|
569
573
|
tokenType: n
|
|
@@ -575,7 +579,11 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
575
579
|
return window.addEventListener("storage", e), () => {
|
|
576
580
|
window.removeEventListener("storage", e);
|
|
577
581
|
};
|
|
578
|
-
}, [
|
|
582
|
+
}, [
|
|
583
|
+
l,
|
|
584
|
+
s,
|
|
585
|
+
c
|
|
586
|
+
]), {
|
|
579
587
|
clearAuthenticationToken: l,
|
|
580
588
|
setAuthenticationToken: c
|
|
581
589
|
};
|