From e13d31a40c23b321b6bb476846f57c2bbd2c1eb0 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Wed, 25 Mar 2020 14:59:32 +0200 Subject: [PATCH] check for valid email in Intro --- src/routes/Intro/Intro.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/Intro/Intro.js b/src/routes/Intro/Intro.js index 9abb4cfb3..027c802e8 100644 --- a/src/routes/Intro/Intro.js +++ b/src/routes/Intro/Intro.js @@ -110,7 +110,7 @@ const Intro = ({ queryParams }) => { }); }, []); const loginWithEmail = React.useCallback(() => { - if (typeof state.email !== 'string' || state.email.length === 0) { + if (typeof state.email !== 'string' || state.email.length === 0 || !emailRef.current.validity.valid) { dispatch({ type: 'error', error: 'Invalid email' }); return; } @@ -145,7 +145,7 @@ const Intro = ({ queryParams }) => { window.location.replace('#/'); }, [state.termsAccepted]); const signup = React.useCallback(() => { - if (typeof state.email !== 'string' || state.email.length === 0) { + if (typeof state.email !== 'string' || state.email.length === 0 || !emailRef.current.validity.valid) { dispatch({ type: 'error', error: 'Invalid email' }); return; }