diff --git a/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx b/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx index f8093e1f4..b95ecf5e1 100644 --- a/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx +++ b/frontend/app/components/ForgotPassword/ResetPasswordRequest.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { Form, Input, Loader, Button, Icon } from 'UI'; +import { Loader, Icon } from 'UI'; import ReCAPTCHA from 'react-google-recaptcha'; import { observer } from 'mobx-react-lite'; import { useStore } from 'App/mstore'; +import {Form, Input, Button } from 'antd' function ResetPasswordRequest() { const { userStore } = useStore(); @@ -20,8 +21,8 @@ function ResetPasswordRequest() { if (name === 'email') setEmail(value); }; - const onSubmit = (e: any) => { - e.preventDefault(); + const onSubmit = () => { + // e.preventDefault(); if (CAPTCHA_ENABLED && recaptchaRef.current) { recaptchaRef.current.execute(); } else if (!CAPTCHA_ENABLED) { @@ -30,19 +31,21 @@ function ResetPasswordRequest() { }; const handleSubmit = (token?: any) => { - if (CAPTCHA_ENABLED && recaptchaRef.current && (token === null || token === undefined)) return; + if (CAPTCHA_ENABLED && recaptchaRef.current && (token === null || token === undefined)) return; setError(null); requestResetPassword({ email: email.trim(), 'g-recaptcha-response': token }) .then((response: any) => { setRequested(true); - if (response && response.errors && response.errors.length > 0) { - setError(response.errors[0]); - } - }); + // if (response && response.errors && response.errors.length > 0) { + // setError(response.errors[0]); + // } + }).catch((err: any) => { + setRequested(false); + }); }; return ( -
); diff --git a/frontend/app/components/Login/Login.tsx b/frontend/app/components/Login/Login.tsx index 990e771e9..559f1bd9c 100644 --- a/frontend/app/components/Login/Login.tsx +++ b/frontend/app/components/Login/Login.tsx @@ -10,7 +10,8 @@ import { toast } from 'react-toastify'; import { ENTERPRISE_REQUEIRED } from 'App/constants'; import { useStore } from 'App/mstore'; import { forgotPassword, signup } from 'App/routes'; -import { Button, Form, Icon, Input, Link, Loader, Tooltip } from 'UI'; +import { Icon, Link, Loader, Tooltip } from 'UI'; +import { Button, Form, Input } from 'antd'; import Copyright from 'Shared/Copyright'; @@ -24,12 +25,12 @@ interface LoginProps { } const Login = ({ - location, -}: LoginProps) => { + location + }: LoginProps) => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const CAPTCHA_ENABLED = React.useMemo(() => { - return window.env.CAPTCHA_ENABLED === 'true' + return window.env.CAPTCHA_ENABLED === 'true'; }, []); const recaptchaRef = useRef