@pooflabs/web 0.0.47-rc.2 → 0.0.47-rc.3

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.
@@ -13302,6 +13302,24 @@ function loginViaPopup() {
13302
13302
  const VALID_PROVIDERS = ['injected', 'google', 'apple', 'deeplink'];
13303
13303
  // Storage key for preserving the original path before OAuth redirect
13304
13304
  const PHANTOM_ORIGINAL_PATH_KEY = 'phantom_oauth_original_path';
13305
+ // Cookie name for storing the return origin when using an OAuth redirect proxy
13306
+ const AUTH_RETURN_COOKIE = 'tarobase_auth_return';
13307
+ /**
13308
+ * Store the current origin in a cookie on the parent domain so an OAuth redirect
13309
+ * proxy page can relay back to this app after the OAuth flow completes.
13310
+ */
13311
+ function storeReturnOrigin() {
13312
+ if (typeof window === 'undefined' || typeof document === 'undefined')
13313
+ return;
13314
+ const origin = window.location.origin;
13315
+ // Derive parent domain (e.g., foo-preview.poof.new → .poof.new)
13316
+ const parts = window.location.hostname.split('.');
13317
+ const domain = parts.length >= 2 ? '.' + parts.slice(-2).join('.') : window.location.hostname;
13318
+ try {
13319
+ document.cookie = `${AUTH_RETURN_COOKIE}=${encodeURIComponent(origin)}; domain=${domain}; path=/; max-age=300; SameSite=None; Secure`;
13320
+ }
13321
+ catch (_a) { }
13322
+ }
13305
13323
  /**
13306
13324
  * Check if the current URL contains Phantom OAuth callback parameters.
13307
13325
  * Phantom uses various params like phantom_encryption_public_key, data, nonce for deeplink callbacks,
@@ -13425,6 +13443,15 @@ function getEffectiveRedirectUrl(configuredRedirectUrl) {
13425
13443
  }
13426
13444
  // If explicitly configured, use that
13427
13445
  if (configuredRedirectUrl) {
13446
+ // If redirecting to a different origin (proxy), store a cookie so the
13447
+ // proxy page knows where to relay the OAuth params back to
13448
+ try {
13449
+ const redirectOrigin = new URL(configuredRedirectUrl).origin;
13450
+ if (redirectOrigin !== window.location.origin) {
13451
+ storeReturnOrigin();
13452
+ }
13453
+ }
13454
+ catch (_a) { }
13428
13455
  return configuredRedirectUrl;
13429
13456
  }
13430
13457
  // Default to origin (base URL) - this is safer than using the full href
@@ -13451,7 +13478,7 @@ async function loadDependencies() {
13451
13478
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
13452
13479
  import('react'),
13453
13480
  import('react-dom/client'),
13454
- Promise.resolve().then(function () { return require('./index-CKyr2iF2.js'); })
13481
+ Promise.resolve().then(function () { return require('./index-CvBV6aJx.js'); })
13455
13482
  ]);
13456
13483
  // Extract default export from ESM module namespace
13457
13484
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -34876,4 +34903,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
34876
34903
  exports.signTransaction = signTransaction;
34877
34904
  exports.subscribe = subscribe;
34878
34905
  exports.useAuth = useAuth;
34879
- //# sourceMappingURL=index-DvYAMJCz.js.map
34906
+ //# sourceMappingURL=index-suqVs0tl.js.map