@insforge/react 1.0.2-dev.4 → 1.0.2-dev.6
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/atoms.cjs.map +1 -1
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs.map +1 -1
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +2 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -514,16 +514,7 @@ var InsforgeManager = class _InsforgeManager {
|
|
|
514
514
|
}
|
|
515
515
|
this.isInitializing = true;
|
|
516
516
|
try {
|
|
517
|
-
await this.
|
|
518
|
-
const sessionResult = this.sdk.auth.getCurrentSession();
|
|
519
|
-
const hasToken = !!sessionResult.data?.session?.accessToken;
|
|
520
|
-
if (hasToken) {
|
|
521
|
-
await this.loadAuthState();
|
|
522
|
-
} else if (this.user === void 0) {
|
|
523
|
-
this.user = null;
|
|
524
|
-
this.isLoaded = true;
|
|
525
|
-
this.notifyListeners();
|
|
526
|
-
}
|
|
517
|
+
await this.loadAuthState();
|
|
527
518
|
} finally {
|
|
528
519
|
this.isInitializing = false;
|
|
529
520
|
}
|
|
@@ -554,8 +545,7 @@ var InsforgeManager = class _InsforgeManager {
|
|
|
554
545
|
async loadAuthState() {
|
|
555
546
|
try {
|
|
556
547
|
const sessionResult = this.sdk.auth.getCurrentSession();
|
|
557
|
-
const
|
|
558
|
-
const token2 = session?.accessToken || null;
|
|
548
|
+
const token2 = sessionResult.data?.session?.accessToken || null;
|
|
559
549
|
if (!token2) {
|
|
560
550
|
this.user = null;
|
|
561
551
|
if (this.config.onAuthChange) {
|
|
@@ -2220,7 +2210,6 @@ function InsforgeProviderCore({
|
|
|
2220
2210
|
const unsubscribe = manager.subscribe((newState) => {
|
|
2221
2211
|
setState(newState);
|
|
2222
2212
|
});
|
|
2223
|
-
void manager.initialize();
|
|
2224
2213
|
return () => {
|
|
2225
2214
|
unsubscribe();
|
|
2226
2215
|
};
|