diff --git a/.env b/.env index 079db2f..8db0aa6 100644 --- a/.env +++ b/.env @@ -18,4 +18,6 @@ REACT_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api REACT_APP_SITE_CONTACT_US=https://www.float.sg/contact REACT_APP_SITE_TERMS=https://www.float.sg/terms REACT_APP_SITE_ABOUT_US=https://www.float.sg/about -REACT_APP_SESSION_TIMEOUT=300000 \ No newline at end of file + +REACT_APP_LOGIN_ERROR_TIMEOUT=5000 +REACT_APP_SESSION_TIMEOUT=300000 diff --git a/src/app/modules/auth/components/Login.tsx b/src/app/modules/auth/components/Login.tsx index ff2e053..4371d9d 100644 --- a/src/app/modules/auth/components/Login.tsx +++ b/src/app/modules/auth/components/Login.tsx @@ -49,18 +49,20 @@ export function Login() { setStatus('The login details are incorrect') setSubmitting(false) setLoading(false) - console.log(auth) //remove later return } saveAuth(auth) setCurrentUser(auth.profile) - console.log(auth) //remove later } catch (error) { console.error(error) saveAuth(undefined) setStatus('The login details are incorrect') setSubmitting(false) setLoading(false) + } finally { + setTimeout(()=>{ + setStatus('') + }, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT)) } }, }) @@ -130,14 +132,6 @@ export function Login() { {/* end::Separator */} - {formik.status ? ( -