@geode/opengeodeweb-front 9.13.1-rc.6 → 9.13.1-rc.8
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/Recaptcha.vue
CHANGED
|
@@ -81,28 +81,16 @@
|
|
|
81
81
|
}
|
|
82
82
|
})
|
|
83
83
|
async function submit_recaptcha() {
|
|
84
|
-
const response = await $fetch(
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
email: email.value,
|
|
91
|
-
launch: launch.value,
|
|
92
|
-
},
|
|
84
|
+
const response = await $fetch.raw(`/.netlify/functions/recaptcha`, {
|
|
85
|
+
method: "POST",
|
|
86
|
+
body: {
|
|
87
|
+
name: name.value,
|
|
88
|
+
email: email.value,
|
|
89
|
+
launch: launch.value,
|
|
93
90
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
infra_store.$patch({
|
|
99
|
-
is_captcha_validated: response.status === 200,
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
console.log("response", response)
|
|
91
|
+
})
|
|
92
|
+
infra_store.$patch({
|
|
93
|
+
is_captcha_validated: response.status === 200,
|
|
94
|
+
})
|
|
107
95
|
}
|
|
108
96
|
</script>
|
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
42
42
|
"type": "module",
|
|
43
|
-
"version": "9.13.1-rc.
|
|
43
|
+
"version": "9.13.1-rc.8",
|
|
44
44
|
"main": "./nuxt.config.js",
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@geode/opengeodeweb-back": "next",
|
|
@@ -14,27 +14,55 @@ describe("recaptcha.js", () => {
|
|
|
14
14
|
describe("wrong params", () => {
|
|
15
15
|
test("name", () => {
|
|
16
16
|
const name = "test"
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const event = {
|
|
18
|
+
body: JSON.stringify({
|
|
19
|
+
name,
|
|
20
|
+
email,
|
|
21
|
+
launch,
|
|
22
|
+
}),
|
|
23
|
+
}
|
|
24
|
+
const result = check_recaptcha_params(event)
|
|
25
|
+
expect(result.statusCode).toBe(internal_error)
|
|
19
26
|
})
|
|
20
27
|
|
|
21
28
|
test("email", () => {
|
|
22
29
|
const email = "test"
|
|
23
|
-
const
|
|
24
|
-
|
|
30
|
+
const event = {
|
|
31
|
+
body: JSON.stringify({
|
|
32
|
+
name,
|
|
33
|
+
email,
|
|
34
|
+
launch,
|
|
35
|
+
}),
|
|
36
|
+
}
|
|
37
|
+
const result = check_recaptcha_params(event)
|
|
38
|
+
expect(result.statusCode).toBe(internal_error)
|
|
25
39
|
})
|
|
26
40
|
|
|
27
41
|
test("launch", () => {
|
|
28
42
|
const launch = true
|
|
29
|
-
const
|
|
30
|
-
|
|
43
|
+
const event = {
|
|
44
|
+
body: JSON.stringify({
|
|
45
|
+
name,
|
|
46
|
+
email,
|
|
47
|
+
launch,
|
|
48
|
+
}),
|
|
49
|
+
}
|
|
50
|
+
const result = check_recaptcha_params(event)
|
|
51
|
+
expect(result.statusCode).toBe(internal_error)
|
|
31
52
|
})
|
|
32
53
|
})
|
|
33
54
|
|
|
34
55
|
describe("right params", () => {
|
|
35
56
|
test("name", () => {
|
|
36
|
-
const
|
|
37
|
-
|
|
57
|
+
const event = {
|
|
58
|
+
body: JSON.stringify({
|
|
59
|
+
name,
|
|
60
|
+
email,
|
|
61
|
+
launch,
|
|
62
|
+
}),
|
|
63
|
+
}
|
|
64
|
+
const result = check_recaptcha_params(event)
|
|
65
|
+
expect(result.statusCode).toBe(success)
|
|
38
66
|
})
|
|
39
67
|
})
|
|
40
68
|
})
|