Skip to content

Commit

Permalink
feat(web): add nonce to message
Browse files Browse the repository at this point in the history
  • Loading branch information
kemuru committed Sep 7, 2023
1 parent 653793e commit 3650b3d
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,27 @@ const FormNotifs: React.FC = () => {

const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
const tx = await walletClient?.signMessage({
const nonce = new Date().getTime();
const message = `
Email:
${emailInput}
Nonce:
${nonce}
`;
const signature = await walletClient?.signMessage({
account: address,
message: emailInput,
message: message,
});
const data = [
{
message: emailInput,
message: message,
address,
signature: tx,
signature: signature,
},
];

await uploadSettingsToSupabase(data);
console.log("🚀 ~ file: index.tsx:123 ~ handleSubmit ~ tx:", tx);
};

return (
Expand Down

0 comments on commit 3650b3d

Please sign in to comment.