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
Commit 2d7ac40
Browse filesBrowse the repository at this point in the historyBrowse files
feat(auth): close the one-step door on a managed environment, stamp its password, rename it
The door answers the cloud-managed refusal before reading a proof, writes
the password-age stamp and forced-change clear, ledgers the sessions it
ends, states its closing rule for existing accounts, and is renamed
accept-invitation-one-step; SendTemplateInput.deliverOnly becomes
deliverOnlyData. Pins every gate and state.
Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/34257-one-step-invitation-acceptance.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,10 @@ feat(auth): an invitation is accepted in one step with the proof its mail carrie
12
12
Clause-②: yes (widening)
13
13
Metadata-protocol: none
14
14
15
-
-**The invitation mail carries a mailbox proof.** The accept link in the mail carries a single-use proof bound to the invitation, its address and its expiry; a resend retires it. The proof is never at rest in clear, the stored mail row never holds the proof, and the console's copy-link action answers the link without it.
16
-
-**One door redeems it.**`POST /api/v1/auth/organization/accept-invitation-with-proof` takes the invitation id, the proof, a name and a password. In one request it creates the account (or sets the password of an account whose address is not verified, ending every session that account had), verifies the address, accepts the invitation and signs in. A proof is single-use. A bad proof gets one `INVALID_TOKEN` refusal that does not say which check failed, and the real proof stays usable. The door is rate-limited per client address and per invitation, and runs the sign-up gates: who may sign up, password length, complexity and breach checks, SSO-only mode.
17
-
-**An address with an account signs in as today.** When the address belongs to a verified account, an account with a linked provider, a second factor or a directory-managed account, the door answers `sign_in` and the proof stays unspent.
15
+
-**The invitation mail carries a mailbox proof.** The accept link in the mail carries a single-use proof bound to the invitation, its address and its expiry; a resend retires it. The proof is never at rest in clear, the stored mail row never holds the proof, and the console's copy-link action answers the link without it. The invitation mail is sent inline, never through the durable mail queue, because the queue delivers from the stored row.
16
+
- **One door redeems it.** `POST /api/v1/auth/organization/accept-invitation-one-step` takes the invitation id, the proof, a name and a password. In one request it creates the account (or sets the password of an account whose address is not verified, ending every session that account had with the reason a password reset records), verifies the address, accepts the invitation and signs in. The password-age stamp and the forced-change clear that every password change writes are written too. The proof is spent only by a request that passed every gate; one server process serializes concurrent redemptions of a proof, and across server processes single use is as strong as the store's consume. A bad proof gets one `INVALID_TOKEN` refusal that does not say which check failed, and the real proof stays usable. The door is rate-limited per client network address and per invitation, and runs the sign-up gates before anything is written: email sign-up switched off, SSO-only mode, password length, complexity and breach checks, a name for a new account, and who may sign up. A refused request leaves the proof usable.
17
+
-**An address with an account signs in as today.** The door sets a password on an existing account only when the account's address is not verified and the mailbox is its one claim: an account that is verified, linked to a provider, enrolled in a second factor, provisioned by an identity provider, waiting for its first single sign-on or whose source cannot be read, or a server in SSO-only mode or with email and password off, answers `sign_in`, and the proof stays unspent.
18
+
-**A cloud-managed environment refuses it.** With `OS_CLOUD_MANAGED=1` the door sets no local password: a request carrying a proof answers `409 RESOURCE_CONFLICT`, the cloud-managed refusal, before the proof is read. `CLOUD_MANAGED_REFUSAL_MESSAGES` gains the door's message. A process without the variable is unaffected.
18
19
-**Without the proof, a session must hold the verified invited address.** Called with a session and no proof, the door accepts only when the session's address is the invited one and verified, and otherwise answers `verify_email`. A copied link still owes the verification mail.
19
-
-**`SendTemplateInput.deliverOnly`** (`@objectstack/spec`): render values delivered with the message and never written to the stored mail row. A send carrying them is delivered inline, never through the durable queue. Only the server-side template send declares the key; `POST /email/send` and a script's `ctx.email.send` take a `SendEmailInput`, which has none.
20
-
-**The accept page offers one form.** A signed-out visitor whose link carries the proof sees a name and password form, or a provider sign-in, in place of the sign-in redirect. The accept page does not keep the proof in its address. A provider sign-in returns to the page, which redeems the invitation for the new session. A link without the proof keeps today's path. The `@object-ui/auth` client gains `acceptInvitationWithProof`.
20
+
-**`SendTemplateInput.deliverOnlyData`** (`@objectstack/spec`): render values delivered with the message and never written to the stored mail row, which gives no sign they were overlaid. Required template variables are checked against `data` alone. A send carrying them is delivered inline, never through the durable queue, so its sender gives up queued delivery where a queue is mounted. Only the server-side template send declares the key; `POST /email/send` and a script's `ctx.email.send` take a `SendEmailInput`, which has none.
21
+
-**The accept page offers one form.** A signed-out visitor whose link carries the proof sees a name and password form, or a provider sign-in, in place of the sign-in redirect. The accept page does not keep the proof in its address. A provider sign-in returns to the page, which redeems the invitation for the new session. A link without the proof keeps today's path. The `@object-ui/auth` client gains `acceptInvitationOneStep`, with the types `AuthInvitationOneStepInput` and `AuthInvitationOneStepOutcome`.
0 commit comments