You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
plugin-auth: an invitation mail sent outside a better-auth endpoint still carries the mailbox proof (mint from the manager's own auth context; blocks cloud#4470) #35107
area:clouddomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p1High: required for production / M2repo:cloudCard routed whole to the cloud PM: needs cloud code, a producer or a fact (cloud owns it to closure)
Follow-up to objectstack#34257 / PR #34333 (one-step invitation acceptance). It was found by the cloud#4470 build thread at objectstack b1da9f55db.
What happens
PR #34333 mints the mailbox proof that an invitation mail carries (deliver-only, never stored) inside the plugin's send path. It mints only when the send runs inside a better-auth endpoint context. A host that calls the plugin's sendInvitationEmail from its own code, outside any endpoint, gets no proof, so that mail carries the plain link and the one-step door cannot be used from it.
On the hosted control plane this is the invitation an environment sends on a member's behalf (cloud member-requests.ts, cloud#4467). Invitations sent from the console are not affected: they run inside the endpoint and carry the proof today.
The host cannot fix this cleanly from outside:
runWithEndpointContext lives in @better-auth/core/context, and plugin-auth exports neither that runner nor its proof minting;
a host-side direct @better-auth/core dependency would be a second copy that the host's pin bump does not keep in step.
Ask
When mintProofForSend (or its equivalent) finds no endpoint context, it falls back to the auth manager's own context (getAuthContext().internalAdapter) and mints the proof the same way. That way every caller of the plugin's sendInvitationEmail gets a mail with the proof. Nothing else changes: the proof is still deliver-only and never stored, and the closing rule (oneStepSignInState) still decides what the door does.
Done when
A test calls sendInvitationEmail outside any endpoint context. The delivered mail carries a proof that the one-step door redeems, and no stored mail row holds the proof.
The existing in-endpoint path is unchanged (CONTROL).
Then
cloud#4470 needs no cloud wiring for environment-originated invitations once a release the cloud pins carries this. Its PR ships the console-invite path now, with Part of #4470, and names this card as what remains.
First touch (R1210): the filer's p1 · domain:server is kept → pm:queue.
Themes: install reliability (hosted onboarding) and security (the verified-address rule of #34883). An invitation sent outside a better-auth endpoint, such as the hosted environment's member request, carries no mailbox proof, so the invitee cannot complete onboarding under the verified-address rule. The cloud card waits on it. It goes to repo:objectstack#1, the p1 seat.
Claim: PM loop round 1 (repo:objectstack#5; the maintainer, verbatim, in this seat's session, 2026-11-18T16:32Z: 「这几个p1卡都你处理」, this card among them) · 2026-11-18T16:37Z
Session: session_01Utp6CbUb7TcZK1XUAddUmQ
Thread session: session_01Utp6CZNxUcd9g6ABZNVZKs
Account: os-bill
Branch: claude/project-thread-3baxvp
Worktree: objectstack-issue-35107 (the card thread's container)
Domain: domain:server
Seat: repo:objectstack#5
File surface: packages/plugins/plugin-auth/src/** (+ its tests), one changeset. Stop on breach and report.
Container & model: S, mode:thread (p1), model: default — no path-derived mandate, effort: high (auth proof path)
Clause-②: no
Metadata-protocol: none
Responsibility: plugin-auth's organization plugin in objectstack mints the mailbox proof only inside a better-auth endpoint context; the platform path that covers out-of-endpoint writes is AuthManager.getAuthContext(); reached by cloud#4470's environment-originated invitations (blocked today)
Thread-read: 6968446111
Premise: holds — mintProofForSend (auth-manager-organization-plugin.ts ~772-787) returns undefined with no endpoint context and the caller sends the plain link; no fallback to the manager's own context.
Serial constraints cleared: none — no open PR or claimed card touches the invitation mint (search at claim time; PR #34333 merged).
{
"issue": 35107,
"status": "done",
"branch": "claude/project-thread-3baxvp",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35226",
"session": "session_01Utp6CZNxUcd9g6ABZNVZKs",
"premise_still_valid": true,
"summary": "mintProofForSend reads the endpoint context with tryGetCurrentAuthEndpointContext; with none it mints through the manager's own getAuthContext().internalAdapter, read at send time only and handed to the organization plugin through PluginListHost and OrganizationPluginHost. In-endpoint sends unchanged. A1 partly disproved: on @better-auth/core 1.7.12 getCurrentAuthEndpointContext throws outside an endpoint, so before this change the send landed in the catch (warn, plain link) and never reached the !store return. A2 holds (getAuthContext returns $context; mintInvitationProof takes any store with the two methods). A3: no recursion, the callback is reachable only from a built instance and the getter is read at send time; pinned (building the instance reads it 0 times). head 6269ad7e1, line_budget 153 changed lines (+146/-7, 5 files) vs 3000, files_changed: .changeset/35107-invitation-proof-outside-endpoint.md, plugin-auth src auth-manager-organization-plugin.ts, auth-manager-plugin-list.ts, auth-manager.ts, invitation-one-step-acceptance-34257.test.ts.",
"tests": "head 6269ad7e1. pnpm --filter @objectstack/plugin-auth test under os-verify-lock: VERDICT command-exit 0, Test Files 285 passed (285), Tests 6000 passed, 10 skipped (6010). Targeted: vitest run src/invitation-one-step-acceptance-34257.test.ts: 114 passed. Ablation via scripts/ablation-replace.mjs (fallback replaced by undefined, anchor 1 to 0, blob 5761479e to a1805a14): the out-of-endpoint redeem case and the CONTROL case red, build-order pin green as designed; restored blob == HEAD, git diff HEAD empty. Suite imports src directly, no dist leg.",
"gates": "local: pnpm --filter @objectstack/plugin-auth build && typecheck (incl. check:test-typecheck): VERDICT command-exit 0. dispatch-gates --commands 75; --ran reconciliation exit 0: 75 accounted, 74 run exit 0, 1 NOT MEASURED (pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET, needs whole-workspace dist; CI Build Core). check-plugin-teardown-shape --self-test exit 3 on shallow clone, exit 0 after fetching 621a4876. CI on 6269ad7e1 at report time: 35 success, 16 skipped, 0 failure, 1 in_progress (Test Core 7/10).",
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
"mcp_calls": "2 — mcp__github__issue_read x2 (get, get_comments), 0 writes; plus gh api REST reads of check-runs x2 (reads only)",
"api_writes": "2 — relay pr_create (fleet-write run 44354594733, opened #35226, assignee os-bill, body read back byte-identical 4528 B); relay comment os-dev-report on #35107 via post-stamped.mjs",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": []
}
Close-out 2026-11-18T17:53Z: PR #35226 MERGED as 9e65474ad3; Fixes closed this card. Delivered: an invitation mail sent outside any better-auth endpoint carries the mailbox proof. Nothing remains here. pm:dispatched off.
area:clouddomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p1High: required for production / M2repo:cloudCard routed whole to the cloud PM: needs cloud code, a producer or a fact (cloud owns it to closure)
Activity
objectstack-fleet commentedon Nov 18, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
First touch (R1210): the filer's p1 · domain:server is kept →
pm:queue.Themes: install reliability (hosted onboarding) and security (the verified-address rule of #34883). An invitation sent outside a better-auth endpoint, such as the hosted environment's member request, carries no mailbox proof, so the invitee cannot complete onboarding under the verified-address rule. The cloud card waits on it. It goes to repo:objectstack#1, the p1 seat.
objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ
Claim: PM loop round 1 (repo:objectstack#5; the maintainer, verbatim, in this seat's session, 2026-11-18T16:32Z: 「这几个p1卡都你处理」, this card among them) · 2026-11-18T16:37Z
Session:
session_01Utp6CbUb7TcZK1XUAddUmQThread session:
session_01Utp6CZNxUcd9g6ABZNVZKsAccount:
os-billBranch:
claude/project-thread-3baxvpWorktree:
objectstack-issue-35107(the card thread's container)Domain:
domain:serverSeat:
repo:objectstack#5File surface:
packages/plugins/plugin-auth/src/**(+ its tests), one changeset. Stop on breach and report.Container & model:
S,mode:thread(p1),model: default — no path-derived mandate,effort: high(auth proof path)Clause-②: no
Metadata-protocol: none
Responsibility: plugin-auth's organization plugin in objectstack mints the mailbox proof only inside a better-auth endpoint context; the platform path that covers out-of-endpoint writes is
AuthManager.getAuthContext(); reached by cloud#4470's environment-originated invitations (blocked today)Thread-read: 6968446111
Premise: holds —
mintProofForSend(auth-manager-organization-plugin.ts ~772-787) returns undefined with no endpoint context and the caller sends the plain link; no fallback to the manager's own context.Serial constraints cleared: none — no open PR or claimed card touches the invitation mint (search at claim time; PR #34333 merged).
objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#5 · os-bill · session_01Utp6CZNxUcd9g6ABZNVZKs
os-dev-report
{ "issue": 35107, "status": "done", "branch": "claude/project-thread-3baxvp", "pr": "https://github.com/objectstack-ai/objectstack/pull/35226", "session": "session_01Utp6CZNxUcd9g6ABZNVZKs", "premise_still_valid": true, "summary": "mintProofForSend reads the endpoint context with tryGetCurrentAuthEndpointContext; with none it mints through the manager's own getAuthContext().internalAdapter, read at send time only and handed to the organization plugin through PluginListHost and OrganizationPluginHost. In-endpoint sends unchanged. A1 partly disproved: on @better-auth/core 1.7.12 getCurrentAuthEndpointContext throws outside an endpoint, so before this change the send landed in the catch (warn, plain link) and never reached the !store return. A2 holds (getAuthContext returns $context; mintInvitationProof takes any store with the two methods). A3: no recursion, the callback is reachable only from a built instance and the getter is read at send time; pinned (building the instance reads it 0 times). head 6269ad7e1, line_budget 153 changed lines (+146/-7, 5 files) vs 3000, files_changed: .changeset/35107-invitation-proof-outside-endpoint.md, plugin-auth src auth-manager-organization-plugin.ts, auth-manager-plugin-list.ts, auth-manager.ts, invitation-one-step-acceptance-34257.test.ts.", "tests": "head 6269ad7e1. pnpm --filter @objectstack/plugin-auth test under os-verify-lock: VERDICT command-exit 0, Test Files 285 passed (285), Tests 6000 passed, 10 skipped (6010). Targeted: vitest run src/invitation-one-step-acceptance-34257.test.ts: 114 passed. Ablation via scripts/ablation-replace.mjs (fallback replaced by undefined, anchor 1 to 0, blob 5761479e to a1805a14): the out-of-endpoint redeem case and the CONTROL case red, build-order pin green as designed; restored blob == HEAD, git diff HEAD empty. Suite imports src directly, no dist leg.", "gates": "local: pnpm --filter @objectstack/plugin-auth build && typecheck (incl. check:test-typecheck): VERDICT command-exit 0. dispatch-gates --commands 75; --ran reconciliation exit 0: 75 accounted, 74 run exit 0, 1 NOT MEASURED (pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET, needs whole-workspace dist; CI Build Core). check-plugin-teardown-shape --self-test exit 3 on shallow clone, exit 0 after fetching 621a4876. CI on 6269ad7e1 at report time: 35 success, 16 skipped, 0 failure, 1 in_progress (Test Core 7/10).", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "2 — mcp__github__issue_read x2 (get, get_comments), 0 writes; plus gh api REST reads of check-runs x2 (reads only)", "api_writes": "2 — relay pr_create (fleet-write run 44354594733, opened #35226, assignee os-bill, body read back byte-identical 4528 B); relay comment os-dev-report on #35107 via post-stamped.mjs", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [] }Generated by Claude Code
objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ
ACCEPT → PR #35226 comment 6986325884 · head
6269ad7e· 2026-11-18T17:31Z. Seat landing armed (ready + auto-merge); close-out here on MERGED.objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ
Close-out 2026-11-18T17:53Z: PR #35226 MERGED as
9e65474ad3;Fixesclosed this card. Delivered: an invitation mail sent outside any better-auth endpoint carries the mailbox proof. Nothing remains here.pm:dispatchedoff.