From 741dfa7a7f9c417443b6a5d66c987facdbee2895 Mon Sep 17 00:00:00 2001 From: Mohammad Cheikh Date: Wed, 11 Dec 2024 15:31:51 -0500 Subject: [PATCH] fix siteInfo for passkey signup flow --- packages/sdk-browser/src/sdk-client.ts | 2 +- .../sdk-react/src/components/auth/Auth.tsx | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/sdk-browser/src/sdk-client.ts b/packages/sdk-browser/src/sdk-client.ts index a6215612..e94ad932 100644 --- a/packages/sdk-browser/src/sdk-client.ts +++ b/packages/sdk-browser/src/sdk-client.ts @@ -554,4 +554,4 @@ export class TurnkeyWalletClient extends TurnkeyBrowserClient { getWalletInterface(): WalletInterface { return this.wallet; } -} \ No newline at end of file +} diff --git a/packages/sdk-react/src/components/auth/Auth.tsx b/packages/sdk-react/src/components/auth/Auth.tsx index 8452277d..2e91e149 100644 --- a/packages/sdk-react/src/components/auth/Auth.tsx +++ b/packages/sdk-react/src/components/auth/Auth.tsx @@ -165,17 +165,16 @@ const Auth: React.FC = ({ const handleSignupWithPasskey = async () => { setPasskeySignupError(""); - const siteInfo = `${window.location.href} - ${new Date().toLocaleString( - undefined, - { - year: "numeric", - month: "long", - day: "numeric", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - } - )}`; + const siteInfo = `${ + new URL(window.location.href).hostname + } - ${new Date().toLocaleString(undefined, { + year: "numeric", + month: "long", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + })}`; setPasskeySignupScreen(false); setPasskeyCreationScreen(true); try {