Uncommented client-side CAPTCHA completion check.

This commit is contained in:
2026-01-24 17:59:21 +01:00
parent 82ff813225
commit 52b012402e
2 changed files with 16 additions and 4 deletions

View File

@@ -120,7 +120,10 @@
@expired="captcha = null"
/>
<button class="button button-submit">Sign up</button>
<button
class="button button-submit"
:disabled="submitted"
>Sign up</button>
<a
href="/login"
@@ -146,24 +149,24 @@ const password = ref('');
const passwordConfirm = ref('');
const errorMsg = ref(null);
const submitted = ref(false);
const userInput = ref(null);
const showPassword = ref(false);
const captcha = ref(null);
async function signup() {
errorMsg.value = null;
submitted.value = true;
if (password.value !== passwordConfirm.value) {
errorMsg.value = 'Passwords do not match';
return;
}
/*
if (env.captcha.enabled && !captcha.value) {
errorMsg.value = 'Please complete the CAPTCHA';
return;
}
*/
try {
const newUser = await post('/users', {
@@ -177,6 +180,8 @@ async function signup() {
navigate(`/user/${newUser.username}`, null, { redirect: true });
} catch (error) {
errorMsg.value = error.message;
} finally {
submitted.value = true;
}
}