diff --git a/.env.sample b/.env.sample index 15c1861..a3bb02d 100644 --- a/.env.sample +++ b/.env.sample @@ -28,7 +28,7 @@ CORS_ORIGIN="https://example.org" # sara config SARA_RECV_HOST="https://localhost" # replace the field with your sara.recv entrypoint -# Turnstile config +# turnstile config TURNSTILE_SECRET_KEY="1x0000000000000000000000000000000AA" # openchat-join config diff --git a/src/utils/turnstile.js b/src/utils/turnstile.js index dade2f7..7377d9e 100644 --- a/src/utils/turnstile.js +++ b/src/utils/turnstile.js @@ -20,11 +20,12 @@ exports.validResponse = async ({ const url = "https://challenges.cloudflare.com/turnstile/v0/siteverify"; try { - return await axios.post(url, { + const result = await axios.post(url, { response: turnstileToken, secret: turnstileSecret, remoteip: ipAddress, }); + return result.data; } catch (e) { return { success: false,