From 980fe0b8b12f4cdff3c09b8500bb8bebfe0892ce Mon Sep 17 00:00:00 2001 From: Yun Date: Mon, 19 Aug 2024 08:04:46 -1000 Subject: [PATCH] Fix signup and chain id check (#595) --- packages/keychain/src/components/connect/Signup.tsx | 3 +-- packages/keychain/src/hooks/deploy.ts | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/keychain/src/components/connect/Signup.tsx b/packages/keychain/src/components/connect/Signup.tsx index 5283ce4ff..9b6fcfa21 100644 --- a/packages/keychain/src/components/connect/Signup.tsx +++ b/packages/keychain/src/components/connect/Signup.tsx @@ -85,7 +85,7 @@ export function Signup({ return; } - doSignup(decodeURIComponent(usernameField.value)).catch((e) => { + doSignup(usernameField.value).catch((e) => { // Backward compat with iframes without this permission-policy if (e.message.includes("publickey-credentials-create")) { doPopup(); @@ -125,7 +125,6 @@ export function Signup({ }, } = data; - console.log(origin); const controller = new Controller({ appId: origin, chainId, diff --git a/packages/keychain/src/hooks/deploy.ts b/packages/keychain/src/hooks/deploy.ts index d611bdbcd..061e7c501 100644 --- a/packages/keychain/src/hooks/deploy.ts +++ b/packages/keychain/src/hooks/deploy.ts @@ -40,6 +40,10 @@ export const useDeploy = (): DeployInterface => { async (username: string) => { if (isDeployed) return; + if (!chainId) { + throw new Error("Chain ID not set"); + } + if (chainId === constants.StarknetChainId.SN_MAIN) throw new Error("Mainnet not supported");