Skip to content

Commit

Permalink
chore(web): remove new lines on message
Browse files Browse the repository at this point in the history
  • Loading branch information
kemuru committed Sep 8, 2023
1 parent 2b6cfe4 commit ef94986
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion web/netlify/functions/update-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const supabase = createClient(SUPABASE_URL!, SUPABASE_KEY!);
export const uploadSettingsToSupabase = async function (event: any, context: any) {
try {
const { message, address, signature } = JSON.parse(event.body);
const email = message.replace(/\n|\r/g, "").split("Email:").pop().split("Nonce:")[0].trim();
const email = message.split("Email:").pop().split(",Nonce:")[0].trim();
const nonce = message.split("Nonce:").pop().trim();
console.log(
":rocket: ~ file: index.tsx:42 ~ handleSupabase ~ email, signature, address, nonce:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@ const FormNotifs: React.FC = () => {
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
const nonce = new Date().getTime();
const message = `
Email:
${emailInput}
Nonce:
${nonce}
`;
const message = `Email:${emailInput},Nonce:${nonce}`;
const signature = await walletClient?.signMessage({
account: address,
message: message,
Expand All @@ -64,7 +58,6 @@ const FormNotifs: React.FC = () => {

await uploadSettingsToSupabase(data);
};

return (
<FormContainer onSubmit={handleSubmit}>
{OPTIONS.map(({ label }, index) => (
Expand Down

0 comments on commit ef94986

Please sign in to comment.