diff --git a/components/Recaptcha.vue b/components/Recaptcha.vue index 4102a551..7c561d65 100644 --- a/components/Recaptcha.vue +++ b/components/Recaptcha.vue @@ -19,6 +19,16 @@ site_key: { type: String, required: true }, }) + onMounted(() => { + if (import.meta.client) { + if ( + process.env.NODE_ENV !== "production" || + !infra_store.app_mode !== appMode.appMode.CLOUD + ) { + infra_store.$patch({ is_captcha_validated: true }) + } + } + }) async function submit_recaptcha(token) { try { const response = await $fetch.raw( diff --git a/stores/infra.js b/stores/infra.js index 22ada660..faa6c13b 100644 --- a/stores/infra.js +++ b/stores/infra.js @@ -1,12 +1,11 @@ import { useStorage } from "@vueuse/core" import Status from "@ogw_f/utils/status.js" -import getCaptchaState from "@ogw_f/utils/captcha_state.js" export const use_infra_store = defineStore("infra", { state: () => ({ app_mode: getAppMode(), ID: useStorage("ID", ""), - is_captcha_validated: getCaptchaState(), + is_captcha_validated: false, status: Status.NOT_CREATED, }), getters: { diff --git a/utils/captcha_state.js b/utils/captcha_state.js deleted file mode 100644 index 3b23d9d0..00000000 --- a/utils/captcha_state.js +++ /dev/null @@ -1,11 +0,0 @@ -function getCaptchaState() { - if ( - getAppMode() === appMode.appMode.BROWSER || - getAppMode() === appMode.appMode.DESKTOP - ) { - return true - } - return false -} - -export default getCaptchaState