Skip to content

Commit

Permalink
feat(SignInDialog): generate SIWE URL on the fly (#1566)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny authored Nov 26, 2024
1 parent 8630233 commit 9fb4eac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/SignInDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ const SignInWithEthereum = () => {
.then((res) => res.json())
.then((data) => z.object({ nonce: z.string() }).parse(data));

const url = new URL(window.location.href);

const message = createSiweMessage({
address: address!,
chainId: 1,
domain: new URL(env.NEXT_PUBLIC_SIWE_URL).hostname,
domain: url.hostname,
nonce,
uri: env.NEXT_PUBLIC_SIWE_URL,
uri: url.origin,
version: "1",
});

Expand Down

0 comments on commit 9fb4eac

Please sign in to comment.