400 bad request error when deployed with NuxtHub
📚 What are you trying to do?
Hi,
I want to use turnstile on a website I deploy with NuxtHub.
On my local host, everything works fine, but when I deploy with NuxtHub I always get
[nuxt] [request error] [unhandled] [400],[POST] "https://challenges.cloudflare.com/turnstile/v0/siteverify": 400 Bad Request
I make use of the custom endpoint and helper method.
🔍 What have you tried?
The provided Nuxt Turnstile examples.
ℹ️ Additional context
Dependencies:
- "@nuxt/scripts": "^0.10.1"
- "@nuxtjs/turnstile": "^0.9.12"
- "@nuxthub/core": "^0.8.16"
- "nuxt": "^3.15.4",
Same thing when deployed using Cloudflare pages. Route /_turnstile/validate returns error 500 and as a result my function fails with 400 Bad Request.
I have this deployed on CF pages, same issue here - locally it all works fine. Any fixes?
Did you ever get this resolved? I have the same issue.
Did you ever get this resolved? I have the same issue.
Hi, I managed to solve this - turns out my Cloudflare setup wasn't respecting my nuxt config (from memory)
Adding my secretKey to my nuxt config solved it: secretKey: process.env.NUXT_TURNSTILE_SECRET_KEY
secretKey: process.env.NUXT_TURNSTILE_SECRET_KEY
+1