@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.
@@ -13282,6 +13282,24 @@ function loginViaPopup() {
13282
13282
  const VALID_PROVIDERS = ['injected', 'google', 'apple', 'deeplink'];
13283
13283
  // Storage key for preserving the original path before OAuth redirect
13284
13284
  const PHANTOM_ORIGINAL_PATH_KEY = 'phantom_oauth_original_path';
13285
+ // Cookie name for storing the return origin when using an OAuth redirect proxy
13286
+ const AUTH_RETURN_COOKIE = 'tarobase_auth_return';
13287
+ /**
13288
+ * Store the current origin in a cookie on the parent domain so an OAuth redirect
13289
+ * proxy page can relay back to this app after the OAuth flow completes.
13290
+ */
13291
+ function storeReturnOrigin() {
13292
+ if (typeof window === 'undefined' || typeof document === 'undefined')
13293
+ return;
13294
+ const origin = window.location.origin;
13295
+ // Derive parent domain (e.g., foo-preview.poof.new → .poof.new)
13296
+ const parts = window.location.hostname.split('.');
13297
+ const domain = parts.length >= 2 ? '.' + parts.slice(-2).join('.') : window.location.hostname;
13298
+ try {
13299
+ document.cookie = `${AUTH_RETURN_COOKIE}=${encodeURIComponent(origin)}; domain=${domain}; path=/; max-age=300; SameSite=None; Secure`;
13300
+ }
13301
+ catch (_a) { }
13302
+ }
13285
13303
  /**
13286
13304
  * Check if the current URL contains Phantom OAuth callback parameters.
13287
13305
  * Phantom uses various params like phantom_encryption_public_key, data, nonce for deeplink callbacks,
@@ -13405,6 +13423,15 @@ function getEffectiveRedirectUrl(configuredRedirectUrl) {
13405
13423
  }
13406
13424
  // If explicitly configured, use that
13407
13425
  if (configuredRedirectUrl) {
13426
+ // If redirecting to a different origin (proxy), store a cookie so the
13427
+ // proxy page knows where to relay the OAuth params back to
13428
+ try {
13429
+ const redirectOrigin = new URL(configuredRedirectUrl).origin;
13430
+ if (redirectOrigin !== window.location.origin) {
13431
+ storeReturnOrigin();
13432
+ }
13433
+ }
13434
+ catch (_a) { }
13408
13435
  return configuredRedirectUrl;
13409
13436
  }
13410
13437
  // Default to origin (base URL) - this is safer than using the full href
@@ -13431,7 +13458,7 @@ async function loadDependencies() {
13431
13458
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
13432
13459
  import('react'),
13433
13460
  import('react-dom/client'),
13434
- import('./index-C26G4SZ4.esm.js')
13461
+ import('./index-DOuGYz_U.esm.js')
13435
13462
  ]);
13436
13463
  // Extract default export from ESM module namespace
13437
13464
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -34809,4 +34836,4 @@ async function getIdToken() {
34809
34836
  }
34810
34837
 
34811
34838
  export { useAuth as A, getIdToken as B, PrivyWalletProvider as C, DEFAULT_TEST_ADDRESS as D, EventEmitter4 as E, buildSetDocumentsTransaction as F, clearCache as G, closeAllSubscriptions as H, convertRemainingAccounts as I, createSessionWithPrivy as J, createSessionWithSignature as K, genAuthNonce as L, MockAuthProvider as M, genSolanaMessage as N, OffchainAuthProvider as O, PhantomWalletProvider as P, getCachedData as Q, reconnectWithNewAuth as R, ServerSessionManager as S, refreshSession as T, signSessionCreateMessage as U, WebSessionManager as W, bs58 as a, bufferExports as b, commonjsRequire as c, onAuthLoadingChanged as d, getAuthLoading as e, logout as f, getCurrentUser as g, getConfig as h, init as i, getAuthProvider as j, get$2 as k, login as l, setMany as m, setFile as n, onAuthStateChanged as o, getFiles as p, runQuery as q, require$$0$1 as r, set$1 as s, runQueryMany as t, runExpression as u, runExpressionMany as v, signMessage as w, signTransaction as x, signAndSubmitTransaction as y, subscribe as z };
34812
- //# sourceMappingURL=index-BUuISZtf.esm.js.map
34839
+ //# sourceMappingURL=index-Dumc6uKc.esm.js.map