fix(auth): show correct error when providing wrong current password at credential change (#1549)

This commit is contained in:
martylukyy 2024-05-10 15:40:35 +02:00 committed by GitHub
parent 7134e06379
commit 2a3dcfbf05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,6 +61,11 @@ function Credentials() {
const updateUserMutation = useMutation({
mutationFn: (data: UserUpdate) => APIClient.auth.updateUser(data),
onError: () => {
toast.custom((t) => (
<Toast type="error" body="Error updating credentials. Did you provide the correct current password?" t={t} />
));
},
onSuccess: () => {
logoutMutation.mutate();
}