Skip to content

Commit f50b239

Browse files
committed
fix: early return when no turnstile token was provided
1 parent df36772 commit f50b239

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

control-service/turnstile.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ func ValidateTurnstile(ctx context.Context, token string, remoteIP string, secre
2626
log.Printf("warning: Turnstile remoteIP is empty, skipping validation")
2727
return nil
2828
}
29+
if token == "" {
30+
return fmt.Errorf("no token provided")
31+
}
2932
requestBody, err := json.Marshal(map[string]string{
3033
"secret": secretKey,
3134
"response": token,

0 commit comments

Comments
 (0)