@insforge/react 1.1.6 → 1.1.7-dev.0

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.
@@ -3628,6 +3628,11 @@ function SignInForm({
3628
3628
  }
3629
3629
 
3630
3630
  // src/lib/hosted-auth.ts
3631
+ function getCsrfTokenFromCookie() {
3632
+ if (typeof document === "undefined") return null;
3633
+ const match2 = document.cookie.match(/(?:^|;\s*)insforge_csrf_token=([^;]*)/);
3634
+ return match2 ? decodeURIComponent(match2[1]) : null;
3635
+ }
3631
3636
  function isHostedAuthEnvironment() {
3632
3637
  if (typeof window === "undefined") {
3633
3638
  return false;
@@ -3678,11 +3683,13 @@ function SignIn({ onError, ...uiProps }) {
3678
3683
  isHandlingOAuthRedirectRef.current = false;
3679
3684
  return;
3680
3685
  }
3686
+ const csrfToken = getCsrfTokenFromCookie();
3681
3687
  const legacyUrl = buildLegacyAuthUrl(redirectUrl, {
3682
3688
  accessToken: session.accessToken,
3683
3689
  userId: session.user.id,
3684
3690
  email: session.user.email,
3685
- name: session.user.profile?.name || ""
3691
+ name: session.user.profile?.name || "",
3692
+ csrfToken: csrfToken || void 0
3686
3693
  });
3687
3694
  window.location.href = legacyUrl;
3688
3695
  } catch (err) {
@@ -3930,11 +3937,13 @@ function SignUp({ onError, emailRedirectTo, ...uiProps }) {
3930
3937
  isHandlingOAuthRedirectRef.current = false;
3931
3938
  return;
3932
3939
  }
3940
+ const csrfToken = getCsrfTokenFromCookie();
3933
3941
  const legacyUrl = buildLegacyAuthUrl(redirectUrl, {
3934
3942
  accessToken: session.accessToken,
3935
3943
  userId: session.user.id,
3936
3944
  email: session.user.email,
3937
- name: session.user.profile?.name || ""
3945
+ name: session.user.profile?.name || "",
3946
+ csrfToken: csrfToken || void 0
3938
3947
  });
3939
3948
  window.location.href = legacyUrl;
3940
3949
  } catch (err) {