diff --git a/web/netlify/functions/update-settings.ts b/web/netlify/functions/update-settings.ts index 7ab0ca0da..0e9f86119 100644 --- a/web/netlify/functions/update-settings.ts +++ b/web/netlify/functions/update-settings.ts @@ -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:", diff --git a/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx index 206c3311f..012c2d96c 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx @@ -45,13 +45,7 @@ const FormNotifs: React.FC = () => { const handleSubmit = async (e: React.FormEvent) => { 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, @@ -64,7 +58,6 @@ const FormNotifs: React.FC = () => { await uploadSettingsToSupabase(data); }; - return ( {OPTIONS.map(({ label }, index) => (