fix(e2e): register disposable accounts through the signup bot guard (BUNYIP-384) #378
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-384-e2e-signup-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Makes the E2E suite's disposable-account registration satisfy the BUNYIP-377 signup bot guard (enabled on c-01 staging). Fixes BUNYIP-384.
Root cause
The guard (empty honeypot + a timing
signup_tokenfromGET /v1/auth/register-challenge, submitted no sooner thanSIGNUP_MIN_FILL_SECONDS= 2s) is enabled on c-01, where the deployed-instance E2E runs.registerDisposablePOSTed/v1/auth/registerwith only{email, password}, soverify_signup_not_botrejected it with the uniform 400 ("We couldn't complete your registration..."), failing the change-email / magic-link / password-reset specs. It surfaced on the BUNYIP-380 PR (#377) E2E run but is unrelated to that change.Change
e2e/lib/accounts.tsregisterDisposablenow mirrors the real register form:GET /v1/auth/register-challenge-> readdata.token-> wait ~2.1s (past the min-fill window) ->POST /v1/auth/registerwithsignup_tokenand nocontact_channel(empty honeypot). Added aregisterChallengeroute toe2e/lib/api.ts. When the guard is off (dev / prod) the extra token is ignored server-side, so the helper is uniform across environments.Not touched
signup.spec.tsregisters via the real UI form (which already renders the honeypot + token) and istest.fixme, so it needs no change.Test
npx tsc --noEmitclean. The guard flow end-to-end is validated by this PR's deployed-instance E2E run - the disposable-account specs should go green.Note
This also unblocks BUNYIP-380 (#377): its red E2E was this same guard failure, not the SSE change. After this merges, re-run / rebase #377.
The BUNYIP-377 signup bot guard is enabled on c-01 (staging), where the deployed-instance E2E suite runs. `registerDisposable` POSTed /v1/auth/register with only {email, password}, so with the guard on `verify_signup_not_bot` rejected every disposable registration with the uniform 400 ("We couldn't complete your registration. Please reload the page and try again."), failing the change-email / magic-link / password-reset specs. It surfaced on an unrelated PR's E2E run. Mirror the real register form: GET /v1/auth/register-challenge for the timing token, leave the honeypot (contact_channel) empty, wait past the 2s minimum-fill window, then POST with signup_token. When the guard is off (dev / prod) the extra token is ignored server-side, so the helper stays uniform across environments. The UI-driven signup.spec is unaffected - the rendered form already carries the fields - and needs no change. tsc --noEmit clean; the guard flow itself is exercised by the deployed-instance E2E run. #BUNYIP-384 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>