Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b48b2592d5 |
@@ -38,9 +38,21 @@ function LoginForm() {
|
|||||||
const { token } = data;
|
const { token } = data;
|
||||||
authentication.updateToken(token);
|
authentication.updateToken(token);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
enqueueSnackbar(error?.message || formatMessage('loginForm.error'), {
|
const errors = error?.response?.data?.errors
|
||||||
variant: 'error',
|
? Object.values(error.response.data.errors)
|
||||||
});
|
: [];
|
||||||
|
|
||||||
|
if (errors.length) {
|
||||||
|
for (const [error] of errors) {
|
||||||
|
enqueueSnackbar(error, {
|
||||||
|
variant: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
enqueueSnackbar(error?.message || formatMessage('loginForm.error'), {
|
||||||
|
variant: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user