update: reset captcha after submission

This commit is contained in:
Tony Yang
2025-04-15 15:03:56 +08:00
parent 1b60b3517d
commit 2ec8167b73
5 changed files with 26 additions and 1 deletions
+5
View File
@@ -8,6 +8,8 @@ const username = ref('');
const password = ref('');
const hcaptchaResponse = ref('');
const hcaptchaRef = ref(null);
const usernameError = ref('');
const passwordError = ref('');
@@ -62,6 +64,7 @@ const submit = () => {
}
emit('login-submit', { username: username.value, password: password.value, hcaptchaResponse: hcaptchaResponse.value });
hcaptchaRef.value.reset();
}
</script>
@@ -90,9 +93,11 @@ const submit = () => {
</div>
</div>
<VueHcaptcha
ref="hcaptchaRef"
:sitekey="$hcaptchaSitekey"
@verify="handleHcaptchaVerify"
@expired="handleHcaptchaExpired"
@reset="handleHcaptchaExpired"
/>
<div class="ts-wrap has-top-spaced is-end-aligned">
<button class="ts-button is-fluid" type="submit" :class="{