From c9df0be874c70537511a9f9d358871cf23fdebef Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Fri, 8 Jul 2022 21:07:14 +0530 Subject: [PATCH] Fix captcha loop issue in registration form (#664) --- src/app/templates/auth/Auth.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/templates/auth/Auth.jsx b/src/app/templates/auth/Auth.jsx index 1f76476..f7998fe 100644 --- a/src/app/templates/auth/Auth.jsx +++ b/src/app/templates/auth/Auth.jsx @@ -97,7 +97,7 @@ function Homeserver({ onChange }) { if (!hsList?.length > 0 || selectedHs < 0 || selectedHs >= hsList?.length) { throw new Error(); } - setHs({ selected: hsList[selectedHs], list: hsList, allowCustom: allowCustom }); + setHs({ selected: hsList[selectedHs], list: hsList, allowCustom }); } catch { setHs({ selected: 'matrix.org', list: ['matrix.org'], allowCustom: true }); } @@ -114,8 +114,14 @@ function Homeserver({ onChange }) { return ( <>
- + ( @@ -319,6 +325,7 @@ function Register({ registerInfo, loginFlow, baseUrl }) { if (!isAvail) { actions.setErrors({ username: 'Username is already taken' }); actions.setSubmitting(false); + return; } if (isEmail && values.email.length > 0) { const result = await auth.verifyEmail(baseUrl, values.email, clientSecret, 1);