Skip to content

Commit 74d384b

Browse files
committed
debug turnstile error
1 parent 786cbae commit 74d384b

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ services:
2525
- "APP_DOMAIN_URL=http://localhost:3000"
2626
- "COOKIE_KEY=a_very_long_cookie_secret_a_very_long_cookie_secret_a_very_long_cookie_secret"
2727
- "STATIC_FILE_DIR=/app/static"
28-
- "APP_WORKER_COUNT=10"
28+
- ">=10"
2929
ports:
3030
- "3000:3000"
3131
volumes:

src/utils/turnstile.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,20 @@ async fn validate_turnstile(
8080
Ok(validation_result)
8181
}
8282

83+
8384
pub async fn validate_turnstile_wrapper(response_token: &str) -> Result<bool, TurnstileError> {
8485
let turnstile_secret_key = std::env::var("CLOUDFLARE_TURNSTILE_SITE_KEY");
8586

8687
if let Ok(turnstile_secret_key) = turnstile_secret_key {
8788
if !response_token.is_empty() {
8889
let result = validate_turnstile(&turnstile_secret_key, response_token, None)
8990
.await
90-
.map_err(|e| TurnstileError {
91-
message: format!("Failed to validate Turnstile token: {}", e),
91+
.map_err(|e| {
92+
dbg!(&e);
93+
94+
TurnstileError {
95+
message: format!("Failed to validate Turnstile token: {}", e),
96+
}
9297
})?;
9398

9499
Ok(result.success)

0 commit comments

Comments
 (0)