|
|
@@ -43,7 +43,7 @@
|
|
|
|
|
|
<v-row>
|
|
|
<v-col cols="12" class="captcha-container">
|
|
|
- <AltchaValidation @verified="captchaVerified = true" />
|
|
|
+ <AltchaValidation/>
|
|
|
<v-checkbox
|
|
|
v-model="honeyPotChecked"
|
|
|
:rules="[validateCaptcha]"
|
|
|
@@ -84,6 +84,7 @@
|
|
|
import type { Ref } from '@vue/reactivity'
|
|
|
|
|
|
const router = useRouter()
|
|
|
+const appStore = useAppStore()
|
|
|
|
|
|
const form: Ref<HTMLElement | null> = ref(null)
|
|
|
|
|
|
@@ -96,7 +97,6 @@ const i18n = useI18n()
|
|
|
const email: Ref<string | null> = ref(null)
|
|
|
const name: Ref<string | null> = ref(null)
|
|
|
const message: Ref<string | null> = ref(null)
|
|
|
-const captchaVerified: Ref<boolean> = ref(false)
|
|
|
|
|
|
// Honeypot checkbox (if checked: it's probably a bot)
|
|
|
const honeyPotChecked: Ref<boolean> = ref(false)
|
|
|
@@ -108,7 +108,7 @@ const validateNonEmptyMessage = (message: string | null) =>
|
|
|
(!!message && message.length > 10) || i18n.t("message_must_be_valid")
|
|
|
|
|
|
const validateCaptcha = () =>
|
|
|
- captchaVerified.value && !honeyPotChecked.value || i18n.t("captcha_must_be_validated")
|
|
|
+ appStore.isNoBot && !honeyPotChecked.value || i18n.t("captcha_must_be_validated")
|
|
|
|
|
|
/**
|
|
|
* Submits the contact form.
|
|
|
@@ -171,6 +171,12 @@ const submit = async (): Promise<void> => {
|
|
|
|
|
|
:deep(altcha-widget) {
|
|
|
min-width: 280px;
|
|
|
+
|
|
|
+ @media (max-width: 600px) {
|
|
|
+ .altcha {
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|