fix(auth): remove captcha from login, fix signup captcha flow#3753
fix(auth): remove captcha from login, fix signup captcha flow#3753waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Reworks signup captcha handling to use Turnstile Updates server-side captcha configuration to only protect Written by Cursor Bugbot for commit ec8e276. Configure here. |
Greptile SummaryThis PR fixes two related captcha issues in the auth flows: it completely removes Turnstile from the login page (where it was silently timing out and blocking legitimate users), and replaces the broken
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant F as SignupForm
participant TW as Turnstile Widget
participant CF as Cloudflare
participant API as /sign-up/email
U->>F: Submit form
F->>TW: widget.reset()
F->>F: Start Promise.race (15s timeout)
F->>TW: widget.execute()
TW->>CF: Challenge request
CF-->>TW: Challenge response
alt Success
TW->>F: onSuccess(token)
F->>F: captchaResolveRef.current(token)
F->>API: POST with x-captcha-response header
API-->>F: 200 OK
F->>U: Redirect to /verify
else Error
TW->>F: onError()
F->>F: captchaRejectRef.current(Error)
F->>U: Show "Captcha verification failed"
else Expire
TW->>F: onExpire()
F->>F: captchaRejectRef.current(Error)
F->>U: Show "Captcha verification failed"
else Timeout (15s)
F->>F: setTimeout fires, reject
F->>U: Show "Captcha verification failed"
end
Note over F: finally: clearTimeout, null out refs
Note over F,API: Login: no captcha at all
U->>F: Submit login form
F->>API: POST /sign-in/email (no captcha header)
API-->>F: Response
Reviews (2): Last reviewed commit: "fix(auth): show Turnstile widget at norm..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
* fix(auth): remove captcha from login, fix signup captcha flow * fix(auth): show Turnstile widget at normal size for Managed mode challenges
Summary
/sign-in/emailfrom server-side captcha endpointsgetResponsePromise()approach with canonicalonSuccess/onError/onExpirecallback pattern wired to resolve/reject refs — errors now fail immediately instead of waiting 15sPromise.raceis now cleared infinallyType of Change
Testing
Tested manually
Checklist