Repository navigation
fix: make captcha and the waitlist work from the stock sign-up forms - #176
Merged
Merged
Conversation
The UI client posts sign-up and sign-in as JSON with captcha_token in the body, which is also what the request schema documents. The middleware only looked at the X-Captcha-Token header and form fields, so every request from the stock forms came back captcha_required. It now reads the token from a JSON body up to 64 KB and puts the bytes back, so the handler binds the request exactly as it arrived.
Two things kept the sign-up form's waitlist step from working on a mounted engine. The routes took engine.BasePath() as a prefix on a router that is already grouped at the base path, so they landed on /authsome/authsome/waitlist/join while the client posts to /v1/waitlist/join. agentauth had the same bug and uses "/v1"; so does this now. The join also read only forge's app scope, not the app the publishable-key middleware puts on authsome's context. A join carrying nothing but the key failed with "unable to determine app_id". An explicit app_id still wins.
The server binds sign-up's captcha to "signup" and sign-in's to "signin" and refuses a token issued for anything else. The forms rendered the widget with no action, so a real token never matched and every submission came back captcha_invalid.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- organization: check the notification plugin type assertion, name authorizeInvitationChange's results, drop an unused test return - mfa: stop shadowing err in the SMS override path, group imports in two tests, drop an ineffectual assignment and two always-same test parameters - middleware: blank the unused handler context in the captcha test - gitleaks: allowlist the fake password in the captcha JSON-body test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rollback only ever reverses the newest migration. Since add_invitation_sent_at and add_session_mfa_verified_at landed, a single Rollback undid those instead of api_key_machine_owners, so both downgrade tests stopped reaching its Down: the guard never raised and the ACCESS EXCLUSIVE lock the race test waits for never appeared. The tests now roll back every migration applied after api_key_machine_owners first, so they keep exercising its Down as later migrations land. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juicycleff
added a commit
that referenced
this pull request
Nov 14, 2026
Both sides cleared the same golangci-lint findings in plugins/mfa; keep main's versions, which landed with #176. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
auth.captcha_requiredon and the waitlist plugin registered, nobody can sign up or sign in through the stock UI. There are three separate bugs here, each with a regression test that fails without the fix.What changed
X-Captcha-Tokenheader and form fields. The UI client posts JSON withcaptcha_tokenin the body, which is also what the request schema documents, so every request came backcaptcha_required. It now reads the token from a JSON body up to 64 KB and puts the bytes back. A new test binds a typed request behind the middleware to prove the handler still gets the whole body.engine.BasePath()as a prefix on a router that's already grouped at the base path, so they landed on/authsome/authsome/waitlist/joinwhile the client posts to/v1/waitlist/join. agentauth got the same fix earlier. The join also ignored the app the publishable-key middleware puts on the context (middleware.AppIDFrom), so a join carrying only the key failed with "unable to determine app_id". An explicitapp_idstill wins, so the admin routes behave as before.action, while the server binds each route tosigninorsignup. A real token never matched and came backcaptcha_invalid.api/delegated_plugin_admin_test.gobuilt its path fromeng.BasePath(), so it encoded the doubled path. It uses/v1/admin/waitlist/...now.Testing
go test ./middleware/... ./plugins/... ./api/... ./captcha/... ./extension/...ui/packages/components: vitest (103 passing) andtsc --noEmitRelease
Wakflo is waiting on this. It needs a Go release and a publish of
@authsome/ui-components.Two follow-ups we noticed but left out of this PR:
captcha.verifyaudit events fail with "chronicle: invalid query: resource is required", and aBeforeSignUprefusal surfaces to the client as a 500.