Skip to content

Commit dda202c

Browse files
committed
fix: update the rest of sign in functionality to use Siwe message object
1 parent 14d23c7 commit dda202c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/useSignIn.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type MessageArgs = {
1414
nonce: string,
1515
};
1616
type VerifyArgs = {
17-
message: string,
17+
message: SiweMessage,
1818
signature: string,
1919
};
2020

@@ -52,9 +52,9 @@ export const useSignIn = ({ onSuccess, onError }: UseSignInOptions = {}) => {
5252

5353
const { mutate, mutateAsync, ...rest } = useMutation(
5454
async () => {
55-
const rawMessage = createMessage({ address, chainId: chain.id, nonce });
56-
const message = getMessageBody({ message: rawMessage });
57-
const signature = await signMessageAsync({ message });
55+
const message = createMessage({ address, chainId: chain.id, nonce });
56+
const messageBody = getMessageBody({ message: message });
57+
const signature = await signMessageAsync({ message: messageBody });
5858
const result = await verify({ message, signature }, options);
5959
if (!result) throw new Error("Verification Failed");
6060
},

0 commit comments

Comments
 (0)