From f354130f35bc4ad1208951017397741c4693cee8 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Thu, 30 Mar 2023 20:10:51 +0600 Subject: [PATCH] chore: login error message --- src/components/Login/email-login-form.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/Login/email-login-form.tsx b/src/components/Login/email-login-form.tsx index 32332df84..0b0fc5138 100644 --- a/src/components/Login/email-login-form.tsx +++ b/src/components/Login/email-login-form.tsx @@ -6,6 +6,10 @@ import { TOKEN_COOKIE_NAME } from '../../lib/utils'; const EmailLoginForm: FunctionComponent<{}> = () => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); + const [error, setError] = useState<{ + message: string; + status: number; + } | null>(null); return (
= () => { window.location.href = '/'; } else { console.log('error', json); + setError(json); } }); }} @@ -61,6 +66,11 @@ const EmailLoginForm: FunctionComponent<{}> = () => { value={password} onChange={(e) => setPassword(String((e.target as any).value))} /> + + {error && ( +
{error.message}
+ )} +