fix(captcha): use getResponsePromise for Turnstile execute-on-submit flow#3943
fix(captcha): use getResponsePromise for Turnstile execute-on-submit flow#3943waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Removes Reviewed by Cursor Bugbot for commit 5216d6a. Configure here. |
Greptile SummaryThis PR simplifies the Turnstile CAPTCHA flow on the signup form by replacing a hand-rolled Key changes:
Confidence Score: 5/5Safe to merge — the change is a straightforward simplification that delegates lifecycle management to the Turnstile library's own API, removing fragile manual state. No P0 or P1 issues found. The new flow correctly calls execute() before getResponsePromise(), preserves the isLoading guard, and error handling is unchanged. All previously raised concerns (timeout duration) were reviewed by a senior developer and intentionally accepted. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant Form as SignupForm
participant Widget as TurnstileWidget
participant CF as Cloudflare
User->>Form: Submit signup
Form->>Form: Validate name/email/password
Form->>Widget: widget.reset()
Form->>Widget: widget.execute()
Widget->>CF: Start challenge
CF-->>Widget: onSuccess(token) / onError / onExpire (internally)
Widget-->>Form: getResponsePromise() resolves/rejects (30s timeout)
alt CAPTCHA succeeded
Form->>Form: setFormError(null)
Form->>Form: client.signUp.email({ headers: { x-captcha-response: token } })
else CAPTCHA failed / timed out
Form->>Form: setFormError("Captcha verification failed")
Form->>Form: setIsLoading(false)
end
Reviews (2): Last reviewed commit: "fix(captcha): use getResponsePromise for..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5216d6a. Configure here.
Summary
Type of Change
Testing
Tested manually
Checklist