fix: 500 error on email conflict (#12725)

This commit is contained in:
Alex van Andel
2023-12-13 02:24:36 +00:00
committed by GitHub
parent 3164cd4ae7
commit 2799ddf3a4
2 changed files with 35 additions and 8 deletions
+11 -2
View File
@@ -106,8 +106,17 @@ const ProfileView = () => {
setConfirmAuthEmailChangeWarningDialogOpen(false);
setTempFormValues(null);
},
onError: () => {
showToast(t("error_updating_settings"), "error");
onError: (e) => {
switch (e.message) {
// TODO: Add error codes.
case "email_already_used":
{
showToast(t(e.message), "error");
}
return;
default:
showToast(t("error_updating_settings"), "error");
}
},
});