@insforge/react 1.1.6-test.2 → 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.
package/dist/index.js CHANGED
@@ -4164,6 +4164,11 @@ function SignInForm({
4164
4164
  }
4165
4165
 
4166
4166
  // src/lib/hosted-auth.ts
4167
+ function getCsrfTokenFromCookie() {
4168
+ if (typeof document === "undefined") return null;
4169
+ const match2 = document.cookie.match(/(?:^|;\s*)insforge_csrf_token=([^;]*)/);
4170
+ return match2 ? decodeURIComponent(match2[1]) : null;
4171
+ }
4167
4172
  function isHostedAuthEnvironment() {
4168
4173
  if (typeof window === "undefined") {
4169
4174
  return false;
@@ -4214,11 +4219,13 @@ function SignIn({ onError, ...uiProps }) {
4214
4219
  isHandlingOAuthRedirectRef.current = false;
4215
4220
  return;
4216
4221
  }
4222
+ const csrfToken = getCsrfTokenFromCookie();
4217
4223
  const legacyUrl = buildLegacyAuthUrl(redirectUrl, {
4218
4224
  accessToken: session.accessToken,
4219
4225
  userId: session.user.id,
4220
4226
  email: session.user.email,
4221
- name: session.user.profile?.name || ""
4227
+ name: session.user.profile?.name || "",
4228
+ csrfToken: csrfToken || void 0
4222
4229
  });
4223
4230
  window.location.href = legacyUrl;
4224
4231
  } catch (err) {
@@ -4509,11 +4516,13 @@ function SignUp({ onError, emailRedirectTo, ...uiProps }) {
4509
4516
  isHandlingOAuthRedirectRef.current = false;
4510
4517
  return;
4511
4518
  }
4519
+ const csrfToken = getCsrfTokenFromCookie();
4512
4520
  const legacyUrl = buildLegacyAuthUrl(redirectUrl, {
4513
4521
  accessToken: session.accessToken,
4514
4522
  userId: session.user.id,
4515
4523
  email: session.user.email,
4516
- name: session.user.profile?.name || ""
4524
+ name: session.user.profile?.name || "",
4525
+ csrfToken: csrfToken || void 0
4517
4526
  });
4518
4527
  window.location.href = legacyUrl;
4519
4528
  } catch (err) {