Skip to content

Commit c9df0be

Browse files
committed
Fix captcha loop issue in registration form (cinnyapp#664)
1 parent ca2627d commit c9df0be

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/app/templates/auth/Auth.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function Homeserver({ onChange }) {
9797
if (!hsList?.length > 0 || selectedHs < 0 || selectedHs >= hsList?.length) {
9898
throw new Error();
9999
}
100-
setHs({ selected: hsList[selectedHs], list: hsList, allowCustom: allowCustom });
100+
setHs({ selected: hsList[selectedHs], list: hsList, allowCustom });
101101
} catch {
102102
setHs({ selected: 'matrix.org', list: ['matrix.org'], allowCustom: true });
103103
}
@@ -114,8 +114,14 @@ function Homeserver({ onChange }) {
114114
return (
115115
<>
116116
<div className="homeserver-form">
117-
<Input name="homeserver" onChange={handleHsInput} value={hs?.selected} forwardRef={hsRef} label="Homeserver"
118-
disabled={hs === null || !hs.allowCustom} />
117+
<Input
118+
name="homeserver"
119+
onChange={handleHsInput}
120+
value={hs?.selected}
121+
forwardRef={hsRef}
122+
label="Homeserver"
123+
disabled={hs === null || !hs.allowCustom}
124+
/>
119125
<ContextMenu
120126
placement="right"
121127
content={(hideMenu) => (
@@ -319,6 +325,7 @@ function Register({ registerInfo, loginFlow, baseUrl }) {
319325
if (!isAvail) {
320326
actions.setErrors({ username: 'Username is already taken' });
321327
actions.setSubmitting(false);
328+
return;
322329
}
323330
if (isEmail && values.email.length > 0) {
324331
const result = await auth.verifyEmail(baseUrl, values.email, clientSecret, 1);

0 commit comments

Comments
 (0)