diff --git a/src/app/[lang]/identification/form.tsx b/src/app/[lang]/identification/form.tsx index 58a37818..66eb6be3 100644 --- a/src/app/[lang]/identification/form.tsx +++ b/src/app/[lang]/identification/form.tsx @@ -81,24 +81,25 @@ export function Form() { const { isHuman } = await validateRecaptcha(reCaptchaToken); if (!isHuman) { + setLoading(false); return AlertError(intl.errors.recaptcha.validation); } const { exists } = await findIamCitizen(cedula); if (exists) { + setLoading(false); return AlertError(intl.errors.cedula.exists); } const citizen = await findCitizen(cedula); await setCookie('citizen', citizen); router.push('liveness'); + setLoading(false); } catch (err: any) { Sentry.captureMessage(err.message || err, 'error'); - - return AlertError(intl.errors.cedula.invalid); - } finally { setLoading(false); + return AlertError(intl.errors.cedula.invalid); } });