diff --git a/src/Pages/Authentication/index.js b/src/Pages/Authentication/index.js index 80a16fb..7f8ec8a 100644 --- a/src/Pages/Authentication/index.js +++ b/src/Pages/Authentication/index.js @@ -1,4 +1,3 @@ -import { LoginOutlined } from "@ant-design/icons"; import { Button, Checkbox, @@ -7,7 +6,6 @@ import { Modal, Result, Space, - Tabs, Typography, notification, } from "antd"; @@ -34,29 +32,17 @@ const AuthenticationMethod = { }; export default function Authentication() { - const { t, i18n } = useTranslation(); - const [form] = Form.useForm(); - const [notificationApi, notificationContextHolder] = notification.useNotification(); const [selectedMethod, setSelectedMethod] = useState( AuthenticationMethod.LOGIN ); - const [isRequesting, setIsRequesting] = useState(false); - - const showErrorNotification = (errStatus) => { - if (errStatus === 400) { - notificationApi["error"]({ - message: t("login.request.400.title"), - description: t("login.request.400.description"), - }); - } - }; return ( <> {notificationContextHolder} + get state of account by backend @@ -131,11 +118,14 @@ function Login({ switchMethod, notificationApi }) { useEffect(() => { if (!accountName) return; - console.log("accountName here", step); + // triggered if step was set to pending deletion and the user wants to reactivate the account + if (step === LoginStep._BACK_TO_PASSWORD) { + setStep(LoginStep.PASSWORD); + return; + } // reset step if account name changed for handling the state of the account if (step === LoginStep.PASSWORD || step === LoginStep.INIT_LOGIN) { - console.log("reset step", accountName); setStep(LoginStep.ACCOUNT_NAME); } }, [accountName]); @@ -157,7 +147,7 @@ function Login({ switchMethod, notificationApi }) { type="primary" onClick={() => { console.log("reactivate account"); - setStep(LoginStep.PASSWORD); + setStep(LoginStep._BACK_TO_PASSWORD); }} > {t("authentication.login.stateAccountPendingDeletion.button")}