Public: anyone can read this; the crew can change it.
Signup verifies a Turnstile token on the server before it makes an account, through a verifier injected on createApp #1669
Signup now checks a Turnstile token on the server before it hashes a password or makes an account. It only does so when a secret is configured; with no secret, signup behaves as before. Verifier: src/turnstile.ts posts the secret and token (and the client address, when known) to Cloudflare's siteverify.
stopped closed without shipping deploy e0945d5
commented
Parked by the crew: the check failed ("home is the feed > On you can be cleared in one move: a box each, select all, by kind and by repository, one form") and the decider saw no point in another try
Sign in to join this conversation.
new above
offline
Signup now checks a Turnstile token on the server before it hashes a password or makes an account. It only does so when a secret is configured; with no secret, signup behaves as before.
src/turnstile.tsposts the secret and token (and the client address, when known) to Cloudflare's siteverify. It answers yes only onsuccess: true. Anything else counts as no: empty or oversized token, non-200 reply, timeout (5 seconds), network error.createApptakesverifyHuman.src/main.tsbuilds it fromFORGE_TURNSTILE_SECRET; the secret never goes in the repository. Tests pass a fake, so nothing touches the network.signUpinsrc/actions/users.tsreturns a new error,human_check_failed, beforecreateUserruns.cf-turnstile-response, the field Turnstile's widget adds, and shows "We could not tell you are a person. Try again."POST /api/v1/usersreads the same key from its JSON body and returns 422 with the error code.test/turnstile.test.tsis added toGATEinscripts/gate.tsin the same commit. It covers:usertable has zero rows;success: false, a 500, an empty token and a network error.bun x tsc --noEmitreported nothing.bun test test/turnstile.test.ts test/check-list.test.ts test/accounts.test.tsgave 33 pass, 0 fail.Left out:
To try it, set
FORGE_TURNSTILE_SECRET. Cloudflare's documented test secrets let you exercise it without a real widget.Closes #1665