Fix Turnstile unable to read the siteKey (#1728)

It seems that Nuxt Turnstile's way of setting the key in `runtimeConfig`
is broken and doesn't work properly, resulting in an error in runtime,
because it has to be set. This commit sets the key in `runtimeConfig`
manually instead, which seems to fix the issue.
This commit is contained in:
Sasha Sorokin 2024-06-15 05:26:45 +02:00 committed by GitHub
parent 05d45d9aab
commit 61fd6f1741
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -305,6 +305,8 @@ export default defineNuxtConfig({
// @ts-ignore
globalThis.CF_PAGES_COMMIT_SHA ||
'unknown',
turnstile: { siteKey: '0x4AAAAAAAW3guHM6Eunbgwu' },
},
},
typescript: {
@ -362,9 +364,6 @@ export default defineNuxtConfig({
}
},
},
turnstile: {
siteKey: '0x4AAAAAAAW3guHM6Eunbgwu',
},
nitro: {
moduleSideEffects: ['@vintl/compact-number/locale-data'],
},