@insforge/react 1.0.2-dev.17 → 1.0.2-dev.19

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.cjs CHANGED
@@ -565,8 +565,10 @@ var InsforgeManager = class _InsforgeManager {
565
565
  // Called after hydration to get complete user information beyond what's in cookies
566
566
  async loadAuthState() {
567
567
  try {
568
- const { isLoggedIn } = await this.sdk.auth.restoreSession();
569
- if (!isLoggedIn) {
568
+ const {
569
+ data: { session }
570
+ } = await this.sdk.auth.getCurrentSession();
571
+ if (!session) {
570
572
  this.user = null;
571
573
  if (this.config.onAuthChange) {
572
574
  this.config.onAuthChange(null);
@@ -599,7 +601,8 @@ var InsforgeManager = class _InsforgeManager {
599
601
  }
600
602
  this.isLoaded = true;
601
603
  this.notifyListeners();
602
- return { success: false, error: userResult.error?.message || "failed_to_get_user" };
604
+ const errorMessage = userResult.error?.message ?? "failed_to_get_user";
605
+ return { success: false, error: errorMessage };
603
606
  }
604
607
  } catch (error) {
605
608
  this.user = null;
@@ -659,7 +662,6 @@ var InsforgeManager = class _InsforgeManager {
659
662
  email,
660
663
  password
661
664
  });
662
- console.log("sdkResult", sdkResult);
663
665
  if (sdkResult.data) {
664
666
  await this.handleAuthSuccess(
665
667
  sdkResult.data.accessToken || "",
@@ -4166,7 +4168,6 @@ function SignIn({ onError, ...uiProps }) {
4166
4168
  setError("");
4167
4169
  try {
4168
4170
  const result = await signIn(email, password);
4169
- console.log("result", result);
4170
4171
  if ("error" in result) {
4171
4172
  if (result.statusCode === 403) {
4172
4173
  setStep("awaiting-verification");