@geode/opengeodeweb-front 2.0.0-rc.27 → 2.0.0-rc.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Launcher.vue +2 -29
- package/components/Recaptcha.vue +43 -0
- package/package.json +1 -1
package/components/Launcher.vue
CHANGED
|
@@ -8,16 +8,7 @@
|
|
|
8
8
|
align="center"
|
|
9
9
|
>
|
|
10
10
|
<h4 class="pb-3">Please complete the recaptcha to launch the app</h4>
|
|
11
|
-
<
|
|
12
|
-
<vue-recaptcha
|
|
13
|
-
ref="recaptcha"
|
|
14
|
-
:sitekey="site_key"
|
|
15
|
-
:loadRecaptchaScript="true"
|
|
16
|
-
@expired="is_captcha_validated = false"
|
|
17
|
-
@verify="submit_recaptcha"
|
|
18
|
-
align-self="center"
|
|
19
|
-
/>
|
|
20
|
-
</ClientOnly>
|
|
11
|
+
<!-- <Recaptcha /> -->
|
|
21
12
|
</v-col>
|
|
22
13
|
<v-col
|
|
23
14
|
v-else-if="!cloud_store.is_running && cloud_store.is_connexion_launched"
|
|
@@ -44,24 +35,6 @@
|
|
|
44
35
|
})
|
|
45
36
|
|
|
46
37
|
onMounted(() => {
|
|
47
|
-
|
|
48
|
-
console.log("useRuntimeConfig()", useRuntimeConfig())
|
|
49
|
-
const config = useRuntimeConfig()
|
|
50
|
-
if (config.public.NODE_ENV !== "production") {
|
|
51
|
-
cloud_store.$patch({ is_captcha_validated: true })
|
|
52
|
-
}
|
|
53
|
-
}
|
|
38
|
+
console.log("onMounted", useRuntimeConfig())
|
|
54
39
|
})
|
|
55
|
-
|
|
56
|
-
async function submit_recaptcha(token) {
|
|
57
|
-
try {
|
|
58
|
-
const response = await $fetch.raw(
|
|
59
|
-
`/.netlify/functions/recaptcha?token=${token}`,
|
|
60
|
-
)
|
|
61
|
-
cloud_store.$patch({ is_captcha_validated: response.status == 200 })
|
|
62
|
-
recaptcha.reset()
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.error(error)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
40
|
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<vue-recaptcha
|
|
4
|
+
ref="recaptcha"
|
|
5
|
+
:sitekey="site_key"
|
|
6
|
+
:loadRecaptchaScript="true"
|
|
7
|
+
@expired="is_captcha_validated = false"
|
|
8
|
+
@verify="submit_recaptcha"
|
|
9
|
+
align-self="center"
|
|
10
|
+
/>
|
|
11
|
+
</ClientOnly>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { VueRecaptcha } from "vue-recaptcha"
|
|
16
|
+
|
|
17
|
+
const websocket_store = use_websocket_store()
|
|
18
|
+
const cloud_store = use_cloud_store()
|
|
19
|
+
const { is_captcha_validated } = storeToRefs(cloud_store)
|
|
20
|
+
|
|
21
|
+
const site_key = useRuntimeConfig().public.RECAPTCHA_SITE_KEY
|
|
22
|
+
|
|
23
|
+
onMounted(() => {
|
|
24
|
+
if (process.client) {
|
|
25
|
+
const config = useRuntimeConfig()
|
|
26
|
+
if (config.public.NODE_ENV !== "production") {
|
|
27
|
+
cloud_store.$patch({ is_captcha_validated: true })
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
async function submit_recaptcha(token) {
|
|
33
|
+
try {
|
|
34
|
+
const response = await $fetch.raw(
|
|
35
|
+
`/.netlify/functions/recaptcha?token=${token}`,
|
|
36
|
+
)
|
|
37
|
+
cloud_store.$patch({ is_captcha_validated: response.status == 200 })
|
|
38
|
+
recaptcha.reset()
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(error)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
package/package.json
CHANGED