@rhinestone/1auth 0.7.0 → 0.7.2

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.mjs CHANGED
@@ -8,7 +8,12 @@ import {
8
8
  } from "./chunk-IHBVEU33.mjs";
9
9
  import {
10
10
  createOneAuthProvider
11
- } from "./chunk-THKG3FAG.mjs";
11
+ } from "./chunk-UXBBB7AV.mjs";
12
+ import {
13
+ buildTransactionReview,
14
+ encodeWebAuthnSignature,
15
+ hashCalls
16
+ } from "./chunk-N6KE5CII.mjs";
12
17
  import {
13
18
  getAllSupportedChainsAndTokens,
14
19
  getChainById,
@@ -26,11 +31,6 @@ import {
26
31
  isTokenAddressSupported,
27
32
  resolveTokenAddress
28
33
  } from "./chunk-GUAI55LL.mjs";
29
- import {
30
- buildTransactionReview,
31
- encodeWebAuthnSignature,
32
- hashCalls
33
- } from "./chunk-N6KE5CII.mjs";
34
34
 
35
35
  // src/client.ts
36
36
  import { hashTypedData } from "viem";
@@ -163,7 +163,7 @@ var POPUP_WIDTH = LOADING_MODAL_WIDTH;
163
163
  var POPUP_HEIGHT = 600;
164
164
  var DEFAULT_EMBED_WIDTH = `${LOADING_MODAL_WIDTH}px`;
165
165
  var DEFAULT_EMBED_HEIGHT = "500px";
166
- var DEFAULT_PROVIDER_URL = "https://passkey.1auth.box";
166
+ var DEFAULT_PROVIDER_URL = "https://passkey.1auth.app";
167
167
  function currentWindowOrigin() {
168
168
  if (typeof window === "undefined") return null;
169
169
  const origin = window.location?.origin;
@@ -619,7 +619,7 @@ var OneAuthClient = class {
619
619
  * Falls back to the raw dialog URL string if URL parsing fails (e.g. during
620
620
  * unit tests with non-standard URL formats).
621
621
  *
622
- * @returns The scheme + host + optional port of the dialog app (e.g. `"https://passkey.1auth.box"`).
622
+ * @returns The scheme + host + optional port of the dialog app (e.g. `"https://passkey.1auth.app"`).
623
623
  */
624
624
  getDialogOrigin() {
625
625
  const dialogUrl = this.getDialogUrl();
@@ -1670,7 +1670,7 @@ var OneAuthClient = class {
1670
1670
  };
1671
1671
  const handleMessage = (event) => {
1672
1672
  if (event.origin !== dialogOrigin) return;
1673
- if (event.data?.type === "PASSKEY_CLOSE") {
1673
+ if (event.data?.type === "PASSKEY_CLOSE" && event.source === iframe.contentWindow) {
1674
1674
  resolveClosed(iframeReadyObserved);
1675
1675
  }
1676
1676
  };
@@ -2369,7 +2369,7 @@ var OneAuthClient = class {
2369
2369
  const dialogOrigin2 = this.getDialogOrigin();
2370
2370
  const earlyCloseHandler = (event) => {
2371
2371
  if (event.origin !== dialogOrigin2) return;
2372
- if (event.data?.type === "PASSKEY_CLOSE") {
2372
+ if (event.data?.type === "PASSKEY_CLOSE" && event.source === iframe.contentWindow) {
2373
2373
  userClosedEarly = true;
2374
2374
  cleanup();
2375
2375
  }