update: reset captcha after new message
This commit is contained in:
@@ -6,6 +6,8 @@ const emit = defineEmits(['new-message']);
|
|||||||
const props = defineProps(['locked']);
|
const props = defineProps(['locked']);
|
||||||
|
|
||||||
const text = ref('');
|
const text = ref('');
|
||||||
|
|
||||||
|
const captcha = ref(null);
|
||||||
const captchaResponse = ref(null);
|
const captchaResponse = ref(null);
|
||||||
const captchaVerified = computed(() => {
|
const captchaVerified = computed(() => {
|
||||||
return captchaResponse.value !== null;
|
return captchaResponse.value !== null;
|
||||||
@@ -26,6 +28,7 @@ function submit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
emit('new-message', { text: text.value, captchaResponse: captchaResponse.value });
|
emit('new-message', { text: text.value, captchaResponse: captchaResponse.value });
|
||||||
|
captcha.value.reset();
|
||||||
text.value = '';
|
text.value = '';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -49,6 +52,7 @@ function submit() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<CAPTCHA
|
<CAPTCHA
|
||||||
|
ref="captcha"
|
||||||
:hcaptchaSitekey="$hcaptchaSitekey"
|
:hcaptchaSitekey="$hcaptchaSitekey"
|
||||||
:recaptchaSitekey="$recaptchaSitekey"
|
:recaptchaSitekey="$recaptchaSitekey"
|
||||||
:turnstileSitekey="$turnstileSitekey"
|
:turnstileSitekey="$turnstileSitekey"
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ const emit = defineEmits(['login-submit']);
|
|||||||
|
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const captchaResponse = ref(null);
|
|
||||||
|
|
||||||
|
const captchaResponse = ref(null);
|
||||||
const captchaVerified = computed(() => {
|
const captchaVerified = computed(() => {
|
||||||
return captchaResponse.value !== null;
|
return captchaResponse.value !== null;
|
||||||
});
|
});
|
||||||
@@ -62,6 +62,7 @@ const submit = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
emit('login-submit', { username: username.value, password: password.value, captchaResponse: captchaResponse.value });
|
emit('login-submit', { username: username.value, password: password.value, captchaResponse: captchaResponse.value });
|
||||||
|
captcha.value.reset();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user