made error message to display blow and disappears after 5secs
This commit is contained in:
@@ -49,18 +49,20 @@ export function Login() {
|
|||||||
setStatus('The login details are incorrect')
|
setStatus('The login details are incorrect')
|
||||||
setSubmitting(false)
|
setSubmitting(false)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
console.log(auth) //remove later
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
saveAuth(auth)
|
saveAuth(auth)
|
||||||
setCurrentUser(auth.profile)
|
setCurrentUser(auth.profile)
|
||||||
console.log(auth) //remove later
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
saveAuth(undefined)
|
saveAuth(undefined)
|
||||||
setStatus('The login details are incorrect')
|
setStatus('The login details are incorrect')
|
||||||
setSubmitting(false)
|
setSubmitting(false)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
} finally {
|
||||||
|
setTimeout(()=>{
|
||||||
|
setStatus('')
|
||||||
|
}, 5000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -130,14 +132,6 @@ export function Login() {
|
|||||||
</div>
|
</div>
|
||||||
{/* end::Separator */}
|
{/* end::Separator */}
|
||||||
|
|
||||||
{formik.status ? (
|
|
||||||
<div className='mb-lg-15 alert alert-danger'>
|
|
||||||
<div className='alert-text font-weight-bold'>{formik.status}</div>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
null
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* begin::Form group */}
|
{/* begin::Form group */}
|
||||||
<div className='fv-row mb-8'>
|
<div className='fv-row mb-8'>
|
||||||
<label className='form-label fs-6 fw-bolder text-dark'>Email</label>
|
<label className='form-label fs-6 fw-bolder text-dark'>Email</label>
|
||||||
@@ -221,6 +215,16 @@ export function Login() {
|
|||||||
</div>
|
</div>
|
||||||
{/* end::Action */}
|
{/* end::Action */}
|
||||||
|
|
||||||
|
{/* error message */}
|
||||||
|
{formik.status ? (
|
||||||
|
<div className='mb-lg-15 alert alert-danger'>
|
||||||
|
<div className='alert-text font-weight-bold'>{formik.status}</div>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
null
|
||||||
|
)}
|
||||||
|
{/* end of error message */}
|
||||||
|
|
||||||
<div className='text-gray-500 text-center fw-semibold fs-6'>
|
<div className='text-gray-500 text-center fw-semibold fs-6'>
|
||||||
Not a Member yet?{' '}
|
Not a Member yet?{' '}
|
||||||
<Link to='/auth/registration' className='link-primary'>
|
<Link to='/auth/registration' className='link-primary'>
|
||||||
|
|||||||
Reference in New Issue
Block a user