Skip to content

Commit

Permalink
fix(turnstile.js): bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
supersonictw committed Oct 6, 2024
1 parent 8b8c3ea commit 4c03893
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/utils/turnstile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4c03893

Please sign in to comment.