feat(auth): improved error handling during login (#1523)

This commit is contained in:
soup 2024-05-03 10:00:33 +02:00 committed by GitHub
parent f820060492
commit f8715c193c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,9 +45,9 @@ export const Login = () => {
auth.login(variables.username) auth.login(variables.username)
router.invalidate() router.invalidate()
}, },
onError: () => { onError: (error) => {
toast.custom((t) => ( toast.custom((t) => (
<Toast type="error" body="Wrong password or username!" t={t} /> <Toast type="error" body={error.message || "An error occurred!"} t={t} />
)); ));
} }
}); });