Repository navigation
feat(console): registering from an invitation link joins its organization and enters the app in one step - #30556
Merged
Conversation
…tion Both register pages accept the invitation their ?redirect= names for the account the sign-up just created, switch to its organization and enter the console root, instead of stopping on the accept page and on 'Invitation accepted'. A refused address goes on to the accept page. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUk9sDw68FAQ6MtiV8
…ster pages Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUk9sDw68FAQ6MtiV8
…commit) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUk9sDw68FAQ6MtiV8
…us commit) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUk9sDw68FAQ6MtiV8
…l: none Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUk9sDw68FAQ6MtiV8
Contributor
Author
|
domain:ui#4 · os-sales · session_01L6bhgVfPeFZkN1FP93imKU 维护者速读
席位核对 — ACCEPT · head 3fc0467
Generated by Claude Code |
This was referenced Nov 5, 2026
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.
Requested by Sales · project thread
Part of #30125 (item 2 here; item 4 landed in PR #30490; items 1 and 3 moved to #30206; item 5 is the devx lane's and stays on the card).
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
DefaultRegisterPage行为一致。c045c341真栈上实测属实(注册 → 接受邀请 → 邀请已接受·继续 → 应用)。ui/packages/app-shell/src/console/auth/invitationSignUpJoin.ts(何时算同意)、ui/apps/console/src/pages/auth/RegisterPage.tsx注册后编排里的invitationJoin分支、ui/packages/app-shell/src/console/auth/RegisterPage.tsx的if (user …)三行。pnpm --dir ui exec vitest run apps/console/src/pages/auth/__tests__/invitationSignUpJoin-30125.test.tsx packages/app-shell/src/console/auth/__tests__/invitationSignUpJoin-30125.test.tsx,预期 6 个用例全绿。What changes
Card #30125, item 2: joining by invitation took three screens (register, "Accept invitation", "Invitation accepted … Continue").
@object-ui/app-shell:useInvitationSignUpJoin(redirect)(new export, with typeInvitationSignUpJoin), inconsole/auth/invitationSignUpJoin.ts. It applies only when the page's?redirect=names an invitation (invitationIdOf, the same reading asisInvitationRedirect) AND the session appeared on the page: the first answered session check found nobody signed in (latched during render, sinceisLoadingis raised again by the sign-up in flight). It then reads the invitation (get-invitation), accepts it (accept-invitation), and switches the session to its organization, once per invitation id. Answersnone,joining,joined, orrefused(any throw before the acceptance lands).@object-ui/console:/register: the post-sign-up effect holds whilejoining, and onjoinedmakes one full-page navigation to the console root (withConsoleBase('/')), the way the accept page's Continue does;refusedfalls through to today's steps, which open the accept page, where the server's refusal is shown.@object-ui/app-shell:DefaultRegisterPage: the same hook. It used to go to/after the sign-up and leave the invitation behind; nowjoining/joinedhold an empty layout,joinedentersresolveRootUrl(), andrefusednavigates to the accept page. A visitor signed in when the page opens still goes to/(objectui#11714 unchanged).onSuccessno longer navigates for an invitation sign-up, so it cannot race the join.get-invitation,accept-invitationandset-activeare the routes the accept page already calls..changeset/30125-invitation-sign-up-joins.md,@object-ui/app-shellpatch,@object-ui/consolepatch (Metadata-protocol: nonegrades every entrypatch).Branch: the harness-assigned
claude/project-thread-lp3y66, notclaude/issue-30125-*; the card is #30125.Tests
Two new files, one per register page, real
AuthProviderover a mock client whosegetSessionanswers the session the sign-up created:ui/apps/console/src/pages/auth/__tests__/invitationSignUpJoin-30125.test.tsx(console mounted under a base href of/_console/, as the shipped build is): the sign-up accepts exactly the link's invitation, switches to its organization, and makes exactly one navigation, landing on/_console/; the server refusingget-invitation: nothing accepted, one navigation to/_console/accept-invitation/ID; CONTROL: already signed in on arrival, nothing read or accepted.ui/packages/app-shell/src/console/auth/__tests__/invitationSignUpJoin-30125.test.tsx: the same three forDefaultRegisterPage(refusal renders the accept route; signed-in arrival renders/).Acceptance notes
get-invitation, measured live below) and the invitation stayspending. Underinvite_onlya sign-up with an address that has no invitation at all is already refused atsign-up/email(SELF_REGISTRATION_CLOSED), unchanged.adopt-membership.ts); measured live: the invitation turnsaccepted, the account has one organization.Verification
Base
c045c341. Source headb81f734a; the head adds an evidence commit and its removal, the tree is byte-identical tob81f734a(git diff b81f734a HEADis empty).Live rig and screenshots (os dev, zh-CN, 1440 wide)
examples/app-showcase:pnpm dev -- --fresh -p PORT(objectstack dev --seed-admin, invite_only, single tenancy), consolevitefromui/apps/consolewithDEV_PROXY_TARGETat that port, Playwright Chromium. The administrator (admin@objectos.ai) invites a fresh address overorganization/invite-member; a clean browser opens/accept-invitation/IDsigned out, follows "注册并加入", registers that address, and the script records every screen it has to act on until an app route.Before (main
c045c341, the two register pages restored to the base): sign-up, then/accept-invitation/IDwith 接受邀请, then 邀请已接受 with 继续, then/apps/com.example.showcase/.... Auth requests after the sign-up:get-invitationx4,accept-invitation,set-active.After (
b81f734a): sign-up, then/apps/com.example.showcase/...directly, 6.6 s after submit. Requests after the sign-up:get-invitationx1,accept-invitationx1,set-activex1. The invitation readsacceptedin the administrator'slist-invitations.Mismatch (
b81f734a): A and B are both invited; B registers from A's link.sign-up/email200 (B has an invitation),get-invitation403, noaccept-invitationrequest; the page lands on A's accept page, which shows 邀请不可用 / 您不是该邀请的收件人。 Both invitations stillpending.Tests, ablation, typecheck, lint
pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/console/auth/ packages/app-shell/src/console/organizations/ apps/console/src/pages/auth/onb81f734a: Test Files 59 passed (59), Tests 456 passed (456), lock VERDICT command-exit 0.scripts/ablation-replace.mjs, anchor x1 to x0): the hook never applies (const applies = false && …): 4 failed / 2 passed (both join cases and both refusal cases; the CONTROLs stay green). Restored, blob equals HEAD,git diff HEADempty.applies: 2 failed / 4 passed (both CONTROL cases: an already signed-in visitor would accept). Restored, blob equals HEAD,git diff HEADempty.pnpm --filter @object-ui/app-shell run type-checkandpnpm --filter @object-ui/console run type-check: lock VERDICT command-exit 0.RegisterPage.tsxlines this PR does not change.Derived gates
node scripts/pm/dispatch-gates.mjs --commandsderived 35 families onb81f734a(the final head's tree is identical). Every one ran and exited 0, each recorded ascommand :: exit N;--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED (a derived zero). Alsopnpm --dir ui run check:new-line-citations,check:control-bytesandcheck:spec-symbols: exit 0 each. CI runs the rest.Generated by Claude Code