Skip to content

Fix logic for recaptcha v3 on error states#698

Merged
vsalvino merged 3 commits intomainfrom
fix-recaptcha3
May 9, 2025
Merged

Fix logic for recaptcha v3 on error states#698
vsalvino merged 3 commits intomainfrom
fix-recaptcha3

Conversation

@vsalvino
Copy link
Copy Markdown
Contributor

@vsalvino vsalvino commented May 9, 2025

Certain error states in the recaptcha v3 API do not return a score. However, we were defaulting to a "good" score and therefore the errors were being let through.

This first checks if the request was successful. If so, it then compares the score.

Fallbacks have also been changed from "good" states to sentinel values, which should be helpful for debugging in production.

@vsalvino vsalvino merged commit 9b0fc70 into main May 9, 2025
10 checks passed
@vsalvino vsalvino deleted the fix-recaptcha3 branch May 9, 2025 20:03
@vsalvino vsalvino added this to the 5.0.1 milestone May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant