Base Template
This commit is contained in:
@@ -39,8 +39,8 @@ export default function LoginForm() {
|
||||
});
|
||||
|
||||
const defaultValues = {
|
||||
email: '',
|
||||
password: '',
|
||||
email: 'admin@linksehat.dev',
|
||||
password: 'password',
|
||||
remember: true,
|
||||
};
|
||||
|
||||
@@ -58,15 +58,16 @@ export default function LoginForm() {
|
||||
|
||||
const onSubmit = async (data: FormValuesProps) => {
|
||||
try {
|
||||
await login(data.email, data.password );
|
||||
navigate('/dashboard/one');
|
||||
const loginResult = await login(data.email, data.password );
|
||||
|
||||
navigate('/dashboard');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
reset();
|
||||
|
||||
if (isMountedRef.current) {
|
||||
setError('afterSubmit', { ...error, message: error.message });
|
||||
setError('afterSubmit', { ...error, message: error.data.message });
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -74,6 +75,7 @@ export default function LoginForm() {
|
||||
return (
|
||||
<FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}>
|
||||
<Stack spacing={3}>
|
||||
<Alert severity='info'>Email : admin@linksehat.dev & Password : password</Alert>
|
||||
{!!errors.afterSubmit && <Alert severity="error">{errors.afterSubmit.message}</Alert>}
|
||||
|
||||
<RHFTextField name="email" label="Email address" />
|
||||
|
||||
Reference in New Issue
Block a user