@insforge/react 0.6.7 → 0.6.9

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 CHANGED
@@ -104,8 +104,7 @@ var InsforgeManager = class _InsforgeManager {
104
104
  this.config = { ...this.config, ...config };
105
105
  }
106
106
  // Public initialization method
107
- // Following Clerk's pattern: Even if we have initialState (isLoaded=true from cookies),
108
- // we still need to load full user data from SDK/API
107
+ // Even if we have initialState (isLoaded=true from cookies), we still need to load full user data from SDK/API
109
108
  async initialize() {
110
109
  if (this.isInitializing) {
111
110
  return;
@@ -440,7 +439,13 @@ var InsforgeManager = class _InsforgeManager {
440
439
  return;
441
440
  }
442
441
  if (initialState.userId) {
443
- this.user = initialState.user ?? null;
442
+ const normalizeValue = (val) => val && val !== "null" ? val : "";
443
+ this.user = {
444
+ id: initialState.userId,
445
+ email: normalizeValue(initialState.user?.email),
446
+ name: normalizeValue(initialState.user?.name),
447
+ avatarUrl: normalizeValue(initialState.user?.avatarUrl)
448
+ };
444
449
  } else {
445
450
  this.user = null;
446
451
  }
@@ -1438,7 +1443,6 @@ function SignInForm({
1438
1443
  showVerificationStep = false,
1439
1444
  onVerifyCode
1440
1445
  }) {
1441
- console.log("\u{1F525} [SignInForm] authConfig", authConfig);
1442
1446
  return /* @__PURE__ */ jsxs(AuthContainer, { children: [
1443
1447
  /* @__PURE__ */ jsx(AuthHeader, { title, subtitle }),
1444
1448
  /* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),