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

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
@@ -544,8 +544,8 @@ var InsforgeManager = class _InsforgeManager {
544
544
  // Called after hydration to get complete user information beyond what's in cookies
545
545
  async loadAuthState() {
546
546
  try {
547
- const { isLoggedIn } = await this.sdk.auth.restoreSession();
548
- if (!isLoggedIn) {
547
+ const { data: { session } } = await this.sdk.auth.getCurrentSession();
548
+ if (!session) {
549
549
  this.user = null;
550
550
  if (this.config.onAuthChange) {
551
551
  this.config.onAuthChange(null);
@@ -578,7 +578,8 @@ var InsforgeManager = class _InsforgeManager {
578
578
  }
579
579
  this.isLoaded = true;
580
580
  this.notifyListeners();
581
- return { success: false, error: userResult.error?.message || "failed_to_get_user" };
581
+ const errorMessage = userResult.error?.message ?? "failed_to_get_user";
582
+ return { success: false, error: errorMessage };
582
583
  }
583
584
  } catch (error) {
584
585
  this.user = null;
@@ -638,7 +639,6 @@ var InsforgeManager = class _InsforgeManager {
638
639
  email,
639
640
  password
640
641
  });
641
- console.log("sdkResult", sdkResult);
642
642
  if (sdkResult.data) {
643
643
  await this.handleAuthSuccess(
644
644
  sdkResult.data.accessToken || "",
@@ -4145,7 +4145,6 @@ function SignIn({ onError, ...uiProps }) {
4145
4145
  setError("");
4146
4146
  try {
4147
4147
  const result = await signIn(email, password);
4148
- console.log("result", result);
4149
4148
  if ("error" in result) {
4150
4149
  if (result.statusCode === 403) {
4151
4150
  setStep("awaiting-verification");