Skip to content

Commit 576d3ea

Browse files
committed
fix(recaptach): back to props
1 parent 1053074 commit 576d3ea

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

components/Launcher.vue

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,7 @@
88
align="center"
99
>
1010
<h4 class="pb-3">Please complete the recaptcha to launch the app</h4>
11-
<!-- <Recaptcha site_key="6Lce72wgAAAAAOXrHyDxRQBhk6NDTD80MrXOlgbC" /> -->
12-
<vue-recaptcha
13-
ref="recaptcha"
14-
sitekey="6Lce72wgAAAAAOXrHyDxRQBhk6NDTD80MrXOlgbC"
15-
:loadRecaptchaScript="true"
16-
@expired="is_captcha_validated = false"
17-
@verify="submit_recaptcha"
18-
align-self="center"
19-
/>
11+
<Recaptcha :site_key="site_key" />
2012
</v-col>
2113
<v-col
2214
v-else-if="!cloud_store.is_running && cloud_store.is_connexion_launched"
@@ -28,7 +20,6 @@
2820
</template>
2921

3022
<script setup>
31-
import { VueRecaptcha } from "vue-recaptcha"
3223
const websocket_store = use_websocket_store()
3324
const cloud_store = use_cloud_store()
3425
const { is_captcha_validated } = storeToRefs(cloud_store)
@@ -45,16 +36,4 @@
4536
onMounted(() => {
4637
console.log("onMounted", useRuntimeConfig())
4738
})
48-
49-
async function submit_recaptcha(token) {
50-
try {
51-
const response = await $fetch.raw(
52-
`/.netlify/functions/recaptcha?token=${token}`,
53-
)
54-
cloud_store.$patch({ is_captcha_validated: response.status == 200 })
55-
recaptcha.reset()
56-
} catch (error) {
57-
console.error(error)
58-
}
59-
}
6039
</script>

components/Recaptcha.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<script setup>
1515
import { VueRecaptcha } from "vue-recaptcha"
1616
17-
const websocket_store = use_websocket_store()
1817
const cloud_store = use_cloud_store()
1918
const { is_captcha_validated } = storeToRefs(cloud_store)
2019
@@ -23,7 +22,6 @@
2322
})
2423
const { site_key } = props
2524
26-
// const site_key = useRuntimeConfig().public.RECAPTCHA_SITE_KEY
2725
console.log("site_key", site_key)
2826
2927
onMounted(() => {

0 commit comments

Comments
 (0)