@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.cjs CHANGED
@@ -565,8 +565,8 @@ 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 { data: { session } } = await this.sdk.auth.getCurrentSession();
569
+ if (!session) {
570
570
  this.user = null;
571
571
  if (this.config.onAuthChange) {
572
572
  this.config.onAuthChange(null);
@@ -599,7 +599,8 @@ var InsforgeManager = class _InsforgeManager {
599
599
  }
600
600
  this.isLoaded = true;
601
601
  this.notifyListeners();
602
- return { success: false, error: userResult.error?.message || "failed_to_get_user" };
602
+ const errorMessage = userResult.error?.message ?? "failed_to_get_user";
603
+ return { success: false, error: errorMessage };
603
604
  }
604
605
  } catch (error) {
605
606
  this.user = null;
@@ -659,7 +660,6 @@ var InsforgeManager = class _InsforgeManager {
659
660
  email,
660
661
  password
661
662
  });
662
- console.log("sdkResult", sdkResult);
663
663
  if (sdkResult.data) {
664
664
  await this.handleAuthSuccess(
665
665
  sdkResult.data.accessToken || "",
@@ -4166,7 +4166,6 @@ function SignIn({ onError, ...uiProps }) {
4166
4166
  setError("");
4167
4167
  try {
4168
4168
  const result = await signIn(email, password);
4169
- console.log("result", result);
4170
4169
  if ("error" in result) {
4171
4170
  if (result.statusCode === 403) {
4172
4171
  setStep("awaiting-verification");