diff --git a/frontend/src/hooks/api/actions/useAuthSettingsApi/useAuthSettingsApi.ts b/frontend/src/hooks/api/actions/useAuthSettingsApi/useAuthSettingsApi.ts index c507da7fa645..cfc6fb4026b4 100644 --- a/frontend/src/hooks/api/actions/useAuthSettingsApi/useAuthSettingsApi.ts +++ b/frontend/src/hooks/api/actions/useAuthSettingsApi/useAuthSettingsApi.ts @@ -12,8 +12,9 @@ export const handleBadRequest = async ( if (!setErrors) return; if (res) { const data = await res.json(); - setErrors({ message: data.message }); - throw new Error(data.message); + const message = data.details?.[0]?.message ?? data.message; + setErrors({ message }); + throw new Error(message); } throw new Error();