Skip to content

Commit

Permalink
fix(recaptcha): site_key not a prop anymore
Browse files Browse the repository at this point in the history
get the site_key directly from the launcher component

BREAKING CHANGE: remove site_key prop
  • Loading branch information
JulienChampagnol committed Sep 27, 2023
1 parent 177ddc7 commit d662783
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 2 additions & 6 deletions components/Launcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ const websocket_store = use_websocket_store()
const cloud_store = use_cloud_store()
const { is_cloud_running, is_captcha_validated, is_connexion_launched } = storeToRefs(cloud_store)
const props = defineProps({
site_key: { type: String, required: true }
})
const { site_key } = toRefs(props)
const site_key = useRuntimeConfig().public.RECAPTCHA_SITE_KEY
watch(is_captcha_validated, async (value) => {
if (value === true && process.client) {
Expand All @@ -44,7 +40,7 @@ onMounted(() => {
}
})
async function submit_recaptcha(token) {
async function submit_recaptcha (token) {
try {
const response = await $fetch.raw(`/.netlify/functions/recaptcha?token=${token}`)
cloud_store.$patch({ is_captcha_validated: response.status == 200 })
Expand Down
5 changes: 2 additions & 3 deletions components/Wrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Header :tool_name="tool_name" :cards_list="cards_list" />
</v-col>
<v-col v-if="!is_cloud_running">
<Launcher :site_key="site_key" />
<Launcher />
</v-col>
<v-col v-if="is_cloud_running">
<Stepper />
Expand All @@ -23,9 +23,8 @@ const { is_cloud_running } = storeToRefs(cloud_store)
const props = defineProps({
cards_list: { type: Array, required: true },
site_key: { type: String, required: true }
})
const { cards_list, site_key } = props
const { cards_list } = props
const stepper_tree = inject('stepper_tree')
const { tool_name, route_prefix } = stepper_tree
Expand Down

0 comments on commit d662783

Please sign in to comment.