Files
CatoandClaude f111d9e97e Add shared first-password claims and recovery verification (#42)
Products that created people before they had a password (an invitation,
a login code) can now hand the credential lifecycle to AccountKit:
POST /api/auth/provision/claim gives that identity its first password
under its existing user id. A second identity joins an existing account
only on that account's own password; an invited account without one must
recover through its mailbox first. Verified addresses are never moved,
.invalid addresses are refused, single-use proofs are given back on
failure, and with mail configured an unverified address gets a link, not
a session.

A completed password reset now verifies the address it was sent to when
that address is unchanged, so an imported or invited account with an
unverified address is not refused at sign-in after recovering.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-29 07:51:39 +01:00

13 lines
505 B
JavaScript

/**
* Why a claim (./provisioning) was refused, as stable codes a product's screen
* turns into its own words. Safe to import in the browser.
*/
export const CLAIM_ERRORS = {
invalid: "CLAIM_INVALID",
alreadyClaimed: "CLAIM_ALREADY_CLAIMED",
emailTaken: "CLAIM_EMAIL_TAKEN",
emailNeedsRecovery: "CLAIM_EMAIL_NEEDS_RECOVERY",
linkPasswordMismatch: "CLAIM_LINK_PASSWORD_MISMATCH",
verifiedEmailMismatch: "CLAIM_VERIFIED_EMAIL_MISMATCH",
};
//# sourceMappingURL=claim-errors.js.map