Skip to content

Changelog

For: a developer who must know what changed between two versions of authtempo.

What it does: this page lists each release of the authtempo packages. Every released package has the same version, so the changelog of @authtempo/core lists each release of the group.

The changelog of @authtempo/core:

0.2.0

Minor Changes

  • c79bf6c: Breaking: schema version 17 adds the enterprise setup. The new models are ssoSetupLink, ssoTestRun, and ssoSetupSession. ssoConnection gets draft, version, and setupLinkId. ssoDomain gets setupLinkId. scimToken gets pending and setupLinkId. A storage adapter of your own stores these models and fields, and the conformance suite holds them.

    Apply 0017_schema_v17 on D1, SQLite, and Postgres, or 0005_schema_v17 on MySQL, before you deploy core at version 17. Each adapter refuses a database at version 16.

    The migration adds columns and tables and changes no row. draft and pending have the default false, and version has the default 1. So a connection of version 16 reads as no draft at version 1, and a token of version 16 reads as not pending.

  • d182103: A self account delete (POST /user/delete and the mailed confirm) now writes one organization_member_remove audit row in each organization that the user leaves. The owner of the organization sees it in the organization audit. The row holds the role, self: true, and accountDelete: true in data. It holds no IP and no user agent. An organization that goes with the account and the platform organization get no row. An operator delete of a user writes no such row. The rows go in the same transaction as the delete, so an insert that fails keeps the user and the member rows. On D1 one insert writes all the rows, and it costs 1 query of the 50 of one invocation. So with a solo organization, the self delete and the mailed confirm each take 2 organizations that the user owns with another owner. With no solo organization, each takes 5. The limits of a secret and of a platform operator do not change.

  • ee41ba3: The new config block limits changes two rules of the rate limits. Without it, each limit works as before.

    limits.windows gives a limit family another window, such as "otp:email": { max: 5 }. max is from 1 to 100000, and seconds is from 1 to 86400. Core refuses an unknown family at the start. It also refuses the six families whose window comes from another setting. A higher max lets a caller try more.

    limits.noClientIp: "refuse" ends the shared count of the requests with no client IP. handle answers 403 client_ip_missing to such a request before any route. An in-process call of auth.api with ip: null throws at its first per-IP limit.

    The client has a text for the new code client_ip_missing. The compat error map names it.

  • bc4768d: Each SSO and SCIM audit row now names its organization in the column organizationId. The rows of a connection, a domain, a setup link, a test run, a SCIM token, and a SCIM user or group get it. data.organizationId stays in each row. A row of a platform operator holds data.platform: true. The override enforceOff names the organization too. An operator act on a user names no organization. The first hand back of a setup link now writes one sso_setup_link_ready audit row. A second hand back writes none.

  • 8b3ccc6: Add the route GET /organizations/audit. A member with the permission audit:read reads the audit rows of the organization, oldest first. The owner of the ranks form has the permission. A role of the roles form has it only when the app lists it. The query takes organizationId, after, limit, action, from, and to. The route takes a session only, so an organization token gets 401. Each row shows the actor as member, platform, scim, or app. Only a member row shows the IP and the user agent. A row from before schema version 18 is not in the answer. GET /operator/audit and auth.api.operator.audit.list now take organizationId.

  • 2c2dcbd: The token and role acts of an organization now write one audit row each, with the organization in the column organizationId. A token create writes organization_token_create with the token id, the hint, and the permissions, never the token or its hash. A token revoke writes organization_token_revoke. A role create, update, and delete write organization_role_create, organization_role_update, and organization_role_delete. The update row names the changed fields, never their values. A row of a route act holds the IP and the user agent of the request. The compat create createOrganizationTokenFor writes null for both. Each row commits in one transaction with its act. The token revoke and the role update now run in a transaction. On D1 the role update sends two more statements and each other act one more. A member removal with revokeTokens writes no token revoke row.

  • 7aa0599: The member and invitation acts of an organization now write one audit row each. The acts are a member add, a role change, a member remove or leave, and an invitation create, accept, or revoke. Each row names its organization and holds the IP and the user agent of the request. A row holds no email address. A member remove with revokeTokens holds the count of the revoked tokens in data.revokedTokens and writes no token revoke row. A refused act writes no row. If the audit insert fails, the act does not occur. A SCIM add and an SSO sign-in that adds a member write no member row. revokeInvitation now deletes the invitation and writes its row in one transaction.

  • 1a22e8a: Breaking: core reads the old session cookie tempo_session no more, and the router does not move it.

    Version 0.1 read tempo_session when a request had no __Host-tempo_session, and moved the token to the new name. That read is gone. A browser that holds only the old cookie signs in again. The Better Auth shim and the proxy of @authtempo/next read the old name no more.

    @authtempo/core/credentials no longer exports LEGACY_COOKIE_NAME. sessionCookieNames() answers { cookieName } only, and readSessionToken reads no legacyCookieName. The resolved config has no legacyCookieName.

    A sign-out clears the session cookie only. LEGACY_SESSION_COOKIE stays: the config refuses that name for each other cookie of core, and the Expo storage key of the shim holds it.

  • 5a0384d: The new hook group hooks.request has two points, before and after. They run in handle, around the handler of each matched route, after each rule of the router. An in-process call of auth.api runs neither.

    Each point gets the route key, the path parameters, the URL, the headers, the IP, and json(). json() answers the JSON body through the cap of the route, and the handler then reads the same bytes. It answers undefined on the SCIM routes, on the SAML ACS, and on the two SSO connection writes.

    A hookRefusal in before answers 403 hook_refused, and the handler does not run. Any other throw answers 500 hook_failed. With this hook, each route can answer these two codes. after also gets the status and the code, and it cannot change the answer.

    The event hook.after_failed now has an optional rowId: a request has no row.

  • 1b83f8c: Move the schema to version 18. The audit table gets the column organizationId and an index on organizationId and id. The SSO connection gets certificateEndsAt, expiryStage, expiryNoticeAt, lastSuccessAt, lastFailureAt, and lastFailureStep. The SCIM token and the setup link get expiryStage and expiryNoticeAt. Each of these three tables gets an index on expiryNoticeAt. Each new column is nullable, so an old row stays valid.

    Add the names of the organization audit. The core resource audit has the action read. With the ranks form, only owner holds it. With the roles form, a role holds it only when the app lists it. An app statement named audit now throws a ConfigError. A stored role row never grants audit. Core ignores the audit key of a row that an app stored before 18, and the row keeps its other actions. A role create or update that names audit answers the new code statement_not_grantable (400), also for the owner. There are 12 new audit actions: 11 acts of an organization and sso_setup_link_ready. The route GET /organizations/audit has its contract. No module serves it yet. The operator audit row now names organizationId.

    Add the names of the expiry notices: the hook hooks.sso.expiring, the notice sso_expiring, and the events sso.expiring and sweep.sso_expiry_stopped. Nothing sends them yet.

  • 04792aa: Add POST /sessions/revoke-all, api.session.revokeAll, and client.sessions.revokeAll(). The call ends every session of the user, the caller’s own too, in one transaction. It also ends the second-factor challenges and the handoff codes. The trusted devices, the API tokens, and the OAuth grants stay, as with POST /sessions/revoke-others. The call needs a fresh session, and it shares the limit key session-revoke:user with the two other revoke routes. The answer is { ended }, the count of ended sessions with the caller’s own, and the route clears the session cookie. A session JWT of an ended session lives to its exp.

    POST /revoke-sessions and auth.api.revokeSessions of the Better Auth compat layer now use this one call. Before, they ended the other sessions and then the caller’s session in two calls. A failure of the second call left the caller signed in.

  • d64537a: The TOTP setup takes an email code in place of the password. POST /totp/setup takes { password } or { emailCode }, exactly one. The code is the code of POST /reauth/email, and a right code is spent. api.totp.setup takes { session, password } or { session, emailCode, ip }, and client.totp.setup takes { password } or { emailCode }. A wrong code answers invalid_code, the spent guesses of a code answer too_many_attempts, and both write no row. Each try counts on totp-setup:user, 5 per 15 minutes, as before.

    totp no longer needs password. With no password, the factor stays off by default, so an upgrade turns nothing on. Set totp: {} to turn it on: the gate then covers the magic link, the email code, and social, and the setup takes the email code. A config with totp and neither password nor emailOtp is refused at start with a new message. A session alone still sets up no factor: the thief of a session does not read the owner’s mailbox.

    A proof that the deployment lacks answers not_found and counts no try: password with no password config, and emailCode with emailOtp: false. The passkey method and the email method still take the password.

    The Better Auth compat layer still refuses allowPasswordless: true. Its refusal text changes: core asks for a proof at every change of the factor, and a session alone is no proof.

  • 01e1b69: Store the certificate end and the status of each SSO connection. A SAML connection now keeps certificateEndsAt, the latest notAfter of its certificates. An OIDC connection keeps null. A new certificate set clears expiryStage and sets a new expiryNoticeAt. A draft gets its notice date when the activation writes the connection.

    A SCIM token with an end and a setup link get their first notice date at create. A row from before version 18 gets its dates at its first sign-in or SCIM call.

    The status of each connection in GET /sso/connections now holds the stored values: lastSuccessAt, lastFailureAt, lastFailureStep, certificateEndsAt, and expiryStage. A sign-in writes each time at most once an hour. A test run writes no status. A status write that fails does not stop the sign-in. It emits the new event sso.status_write_failed.

    The events sso.failed, sso.denied, and sso.refused now name organizationId when the connection is known. Their default log lines do not change. The setup page shows the certificate end of a SAML draft.

  • 35325a9: The sweep sends the expiry notices of SAML certificates, SCIM tokens, and setup links, 30, 7, and 1 days before the end. A setup link gets the notice of 1 day only. The sweep claims each stage with one conditional update before it sends, so two sweeps at once send it one time. The owners get one mail each, at most 10 for each row. The owner read skips each member with exactly one role below the owner rank, and reads one page of 100 of the other members. With more than 50 role names below the owner rank, it skips no member. More than 100 members that the read keeps cut it. Then an owner past the page gets no mail, and the sweep writes notice.mail_failed with a RangeError. A disabled SAML connection gets no notice and keeps its notice date. After an enable, the next sweep sends the nearest due stage. Then the sweep emits sso.expiring and runs hooks.sso.expiring, also while account.notices is off. A failed mail writes notice.mail_failed, and no sweep sends it again. The step reads at most 5 rows of each kind, in the calls that stay, and each mail counts as one call. SweepResult gets ssoExpiryNotices. A storage fault of the step writes sweep.sso_expiry_stopped. On D1 the sweep sends 1 more query for each kind that is on.

  • 4d41f15: Add the SSO setup link. An owner of an organization mints a link and sends it to the IT admin of a customer. The IT admin opens it and fills in drafts: a domain, a connection, and a SCIM token. A test sign-in must pass for the current draft. The IT admin hands back, and the owner reads the preview and activates. Nothing goes live before the activation. The activation sends the version of the preview that the owner read. It answers conflict when the draft, a domain, or the pending SCIM token changed after that read. The sweep deletes the setup links, setup sessions, and test runs 30 days after they expired. It deletes the pending SCIM token of each deleted link too. It counts the rows in ssoSetupRows.

    It is off by default. Turn it on with sso: { setup: {} }. It needs sso and organizations. It throws a ConfigError at start when account.notices is false, because the owners learn of a ready setup by a notice. ttlHours sets the life of a link from 1 to 168 hours, and the default is 72. page replaces the setup page of core. The hook hooks.sso.setupReady runs after each handback.

    The new routes are POST /sso/setup-links/create, GET /sso/setup-links/list, GET /sso/setup-links/get, POST /sso/setup-links/revoke, POST /sso/setup-links/activate, GET /sso/setup, POST /sso/setup/open, POST /sso/setup/domains/add, POST /sso/setup/domains/verify, POST /sso/setup/connection, POST /sso/setup/scim-token, POST /sso/setup/handback, and GET /sso/setup/status. The new codes are setup_link_invalid, setup_link_limit, and setup_not_tested. The new notices are sso_setup_ready and sso_activated. GUIDES holds one typed guide for each of Okta, Entra ID, Google Workspace, generic SAML, and generic OIDC. The client has sso.setupLinks and sso.setup.

    No guide was checked on a real tenant. Each guide shows the date of its read, and a label that the docs do not confirm shows as unconfirmed.

    One risk stays. A person who steals a link before the IT admin uses it can fill a draft that names the provider of the thief. If the owner activates it after a quick read of the preview, the thief can sign in. Every owner gets the notice of a ready setup. Read the preview, and ask the IT admin by a second channel before you activate.

Patch Changes

  • e386ff8: The expiry notice reads the owners of an organization of exactly 100 members in full. Before, the sweep wrote a false notice.mail_failed with a RangeError for such an organization. A member or invitation act in an impersonation now writes the operator as the actor, with data.platform: true. This applies to the core routes and to auth.api.cancelInvitation of the Better Auth compat layer. The organization audit shows such an act as platform, with no IP and no user agent. Before, a core route showed the IP and the user agent of the operator as an act of the member. The compat cancel named the member as the actor. auth.api.revokeInvitation takes a new session option: the session of the caller, which picks the audit actor only and changes no other step. auth.api.inviteMember takes a new session option too: a session of an impersonation gets impersonation_session with status 403, as POST /organizations/invite answers it. auth.api.createInvitation of the compat layer passes the session, so it refuses an impersonation with the code FORBIDDEN and writes nothing.
  • 227d5c6: The in-process token writes now refuse a session of an impersonation, as their routes do. auth.api.tokens.create and auth.api.tokens.update, and auth.api.organizationTokens.create, update, and revoke, answer impersonation_session with status 403 for such a session. They make no token, change no token, and write no audit row. Before, an operator who acted as a member could make a token that outlived the impersonation. The organization audit then named the member as the actor. auth.api.organizationTokens.revoke takes a new session option. In the Better Auth compat layer, createApiKey and updateApiKey pass the session of the headers, for a user key and for an organization key. deleteApiKey passes it for an organization key. So these calls refuse an impersonation with the code FORBIDDEN. deleteApiKey of a user key does not refuse an impersonation, as its core route does not. updateApiKey of each key, and deleteApiKey of an organization key, now also use the session proof rule of plan 12p, as the routes do. So a session from before the proof of its address gets email_unverified. A server call that names userId and has no headers works as before.
  • b456151: An account delete now reads the owner recount of all organizations that the user owns with another owner in one statement. Before, it read the owners of each such organization in its own statement. On D1 each such organization now costs 2 queries of the 50 of one invocation, and the recount costs 1 query for all of them. So on D1 more such organizations fit one delete. A secret takes 1 solo organization and 4 such organizations. On the D1 storage of the compatibility package, a secret takes 5 with no solo organization. With the impersonation tool off, it takes 6. The limits of a platform operator do not change.

0.1.1

Patch Changes

  • No code change. This release is the first publish through the trusted publisher of GitHub Actions, with provenance.

0.1.0

Minor Changes

  • 552820d: Breaking: a storage adapter must have two new port calls, deleteRows and keep. An adapter of your own fails the type check until it adds them.

    deleteRows(model, where) deletes the rows that match and answers them. A row that another caller removed first is not in the answer. D1, SQLite, and Postgres run one DELETE … RETURNING. MySQL reads the ids, reads the rows under their locks by id, and deletes them by id, in one transaction.

    keep() makes the writes of the open transaction so far final, so a later throw undoes only the later writes. D1, SQLite, and the memory store drop their undo entries so far and answer true. Postgres and MySQL isolate the open transaction, so there it does nothing and answers false. The conformance suite holds both calls on every store, with the option deleteRowsStatements for MySQL. The storage of the Better Auth tables answers each row of deleteRows in the shape that a read gives.

  • 8a8c319: Breaking: schema version 16 adds the boolean proved to the session row. A storage adapter of your own stores the field, and the conformance suite holds it.

    Apply 0016_schema_v16 on D1, SQLite, and Postgres, or 0004_schema_v16 on MySQL, before you deploy core at version 16. Each adapter refuses a database at version 15.

    proved is true when the session came after the proof of its address. It is also true when the user has no address and is not anonymous. Core sets it once, at the creation of the session. Only the confirm of a change of address changes it later, to true on the session it keeps. The migration adds the column with the default false. Then it sets true on each session whose user has a verified address. So a verified user keeps the powers of each live session. A session of a user with no address, or with an unverified address, reads false. A user with no address signs in again for verified powers. A user with an unverified address proves it first.

    A Worker at version 15 that still runs after the migration writes false into each new session. Such a session of a user with a verified address ends at its next use, so the person signs in again once. So deploy core at version 16 at once.

  • 39e5ca1: Core exports holdClaim, releaseClaim, and ClaimLostError from its root. holdClaim takes the first statement of a claim of a user, for a writer that is no claim, such as the importer. On Postgres and MySQL it is an update of the unverified user row, which holds the row lock until the commit. On D1, the SQLite drivers, and the memory store it creates the claim lease. Unlike a claim, it takes no stale lease, because a claim can run past the life of its lease. On a store with no isolation the hold then reads the flag of the user. On a verified user it deletes its own lease and throws ClaimLostError, because the sweep can delete a claim’s lease before the hold. holdClaim returns the expiry of its lease, or null on an isolated store. releaseClaim takes that value and deletes the lease by its id and that expiry, in the same transaction. So it never deletes the lease of a claim that took the stale lease of the hold. It answers false when its lease is gone or a claim took it, and the writer then deletes its own rows.

    A claim of the user waits for the hold on Postgres and MySQL. On D1 it answers 409 conflict. On the SQLite drivers and the memory store it retries after a wait, then answers 409. A lease row of the user, live or stale, throws ClaimLostError with held. The writer runs no hook between the two calls, because the lease lives 60 seconds. A writer that stops before the release leaves the lease. A claim takes it after 60 seconds. The app’s scheduled sweep deletes the lease at its first run 60 seconds or more after its write.

    On D1 and the SQLite drivers, the undo of a lease create deletes only a lease of the expiry that it wrote. A claim can create a new lease after the writer’s release. A D1 error after that then keeps the claim’s lease, so a second write of the user meets it.

  • 0347b96: A claim of an address now takes its first statement, then deletes every row that a sign-in trusts, then marks the address verified. It ends the sessions last. The rows are the identities, the passwords, the passkeys, the passkey challenges, and the handoff codes. So a sign-in that reads the user after the flag finds its row gone and opens no session. A sign-in that read the user before the flag holds an unproved session, and the claim’s session delete removes it.

    The first statement decides a race of two claims of one user, so a lost claim writes nothing. On Postgres and MySQL it is the hold: an update of the user row while it is unverified, which takes the row lock first. On D1, the SQLite drivers, and the memory store it is the lease: a claim-lease verification row of the user. A second claim meets the lease and writes nothing. On D1 a second claim answers 409 conflict at once. On the SQLite drivers and the memory store a second claim waits 100 milliseconds before each of its three retries. A retry after the rival ended signs the user in. A retry of a sign-up confirm answers invalid_token, or invalid_code for a code, because the rival’s claim deleted its password row. Else it answers 409 conflict. On Postgres and MySQL two proofs at once answer 200 and 200 with one claim. The hold waits, and the loser’s retry signs in. A sign-up confirm that loses answers invalid_token, or invalid_code for a code. The lease lives 60 seconds, and the sweep deletes it then. The next claim takes a stale lease.

    The password sign-up, the uniform sign-up, and the social sign-up of a new user read the lease in their claim check, live or stale. Each of them created the user, so each lease of that user comes from a claim that started later. A claim can delete before their password or identity create, so that row never outlives the claim. Core exports that check from its root as claimNotStarted.

    The storage port gains the flag isolated. Postgres and MySQL set it true: the open transaction is isolated, and keep answers false in it. D1, the SQLite drivers, and the memory store set it false. The storage of the Better Auth tables takes the value of the adapter under it. The conformance suite holds the flag to keep.

    On D1 each claim sends one more query, the lease. A claim that takes a stale lease sends three more. The sign-ups above send one more query, the read of the lease.

  • b8b54a4: The confirm of a password sign-up keeps the sign-up’s password only in the browser or the app of the sign-up. Any other confirm is a claim.

    A sign-up now gives a sign-up proof: sp_ and 32 random bytes. Each answer holds it as signUpProof, and the route sets it as the HttpOnly cookie __Host-tempo_signup. The cookie lives as long as the link or the code. A known address gets a proof too, so the answer tells no account. The verify row holds the SHA-256 of the proof, so the proof adds no query to the sign-up or the confirm. A resend or a sign-in that carries a proof reads the earlier sign-up rows of the address, one query more.

    A confirm by link or by code that carries the proof keeps the password. The cookie wins over the signUpProof member of the code form. Any other confirm deletes that password, and the person who confirmed gets a proved session. The JSON answers of POST /password/verify and POST /password/verify/code gain passwordKept. The redirect of the link goes to /?password=set when the password went. The person then sets a first password through POST /password/change with no current password. The confirm clears the cookie.

    PasswordSignUpResult gains signUpProof. PasswordVerified gains passwordKept. PasswordVerify, PasswordVerifyCode, PasswordResend, and PasswordSignInFields take signUpProof. The body of POST /password/sign-in, of POST /password/verify/code, and of POST /password/verify/resend takes signUpProof too.

    A resend copies the proof hash to the new row only when the request carries the proof of an earlier row of the same sign-up. A password sign-in that mails a new link or code does the same. Each reads the cookie, else the body member. The resend answer sets the cookie again for the life of the new link or code.

    The root entry exports SIGN_UP_PROOF_COOKIE. The compat entry exports newSignUpProof. CORE_PREFIXES gains sp_. A config with cookieName or lastMethod.cookieName set to __Host-tempo_signup now fails at start.

    Breaking: an app whose sign-up opens the link outside its own browser loses the sign-up’s password at the confirm. A native app whose link opens in the system browser is one. An app on another site than the auth origin is one too, because many browsers drop its third-party proof cookie. Such an app uses password.verifyBy: "code" and sends signUpProof with the code. Else it shows a first-password form after the confirm.

    Breaking: an in-process call of api.password.verifyEmail or verifyCode with no signUpProof deletes the sign-up’s password. Pass the signUpProof of the sign-up’s answer.

  • 28f0699: Core exports PENDING_PROVIDER_PREFIX and isPendingProvider from its root. An importer writes the identity row of a held user with the provider pending$<provider>, and no sign-in finds it. The identity list and the operator user list now skip such a row. An unlink of it answers not_found. Before, both lists showed the row, and an app could unlink it.

  • b6da6a3: The storage port has a new required flag, isolated. A claim reads it to choose its first statement: the hold of the user row, or the lease.

    Breaking: StorageAdapter has the required flag isolated. Set it on your own adapter and on each transaction port that it answers: true when the open transaction is isolated and keep answers false.

  • abf1b79: The request event has a new optional field userId. It is the user of the session row that the request’s token names, read in full or by a peek. The route’s session read sets it, and so do the two refusal steps of the router, which run before the route. So a refusal of a router step names the account of the token, a banned one too. A refusal of the route’s full read sets no userId, as for a banned user’s row. On a request with no session, the field is absent. So an operator can tie a refusal of a route, such as a 429 or a 503 of an SSO connection write, to an account.

    The compat entry @authtempo/core/compat exports ID_TOKEN_PROVIDERS, the providers of the ID-token route. A compatibility package takes its list from it.

    A 401 of the check after the body read of an SSO connection write sends no renewed session cookie, because the session ended. A 403 of that check keeps the cookie, because the session is live.

  • d9fe45b: Breaking: session.maxPerUser now caps the live sessions of a user, 1 to 1000, default 100. Before its insert, a session create ends the oldest sessions of the user past the cap. session.afterEnd and the event session.end get the new reason capped, after the commit and before afterCreate. An impersonation session neither counts nor ends a session. An app whose users keep more than 100 sessions sets a higher cap.

    Each session create sends one more query, the read of the newest sessions of the user, and one more at the cap, the delete. On D1 every pin of a session create moved by one. The tightest is the ID-token claim after a unique-key retry. It sends 48 of the 50 queries of D1 Free, and 49 when the claim writes a pending-end row. On D1 and SQLite, n creates at once can leave n minus 1 sessions past the cap until the next create. So can the creates of a user with an unverified address on Postgres and MySQL. The creates of a verified user there wait on each other and stay at the cap.

    A claim with a session.afterEnd hook on D1, SQLite, or the memory store now ends at most two chunks of 50 sessions. It writes the pending-end row of a ban for the rest, with the new reason claimed. Each such session ends at its next use, and the sweep removes the rest over its runs. That row ends only the sessions whose proved flag is false, so the owner’s sessions stay. Before, each 50 sessions of the claimant added one query, and a reset link over 1000 sessions answered 500 at query 51 on D1. Postgres and MySQL end every session in the claim, as before. A revoke of the platform role does not count a claim’s row as a row of its own.

  • 30e85d8: A session now holds a proof flag, proved, that core sets once at its creation. Only the confirm of a change of address changes it later, to true on the session it keeps. It is false for an anonymous user. For a user with an address, it is the verified flag of that address. For any other user, it is true, because a user with no address has nothing to claim. A handoff copies the flag of its browser session, and an impersonation takes the state of its target. A session.beforeCreate hook cannot set it.

    Every verified-only action reads the flag of the caller’s session with the user’s flag. So a session made before the proof of its address never gains verified powers. A claimant’s session acts as unverified between the claim’s flip and its session delete. It makes no token, no address change, no grant, and no factor there. A caller with no session, such as a tk_ token, keeps the rule of the user row.

    Breaking: api.tokens.create, api.passkeyRegistrationOptions, api.verifyPasskeyRegistration, api.totp.setup, and api.organizationTokens.create take session in place of user or userId. Pass the answer of api.getSession or auth.session. A call with user or userId fails the type check. The input types ApiTokenCreate, TotpSetupInput, and OrganizationTokenCreate changed the same way. The root entry now exports PasskeyRegistrationOptionsInput and PasskeyRegistrationInput, the input types of the two passkey forms.

    Each route passes the session it holds to the other verified-only checks. They are the token list, revoke, and update, and the organization, team, invitation, slug, and organization token calls. Except api.tokens.update and api.organizationTokens.update, the app API forms of these closed flows take no session. So an in-process call there keeps the rule of the user row.

    A claim now deletes the identities, the passwords, the passkeys, the passkey challenges, and the handoff codes before the sessions. The passkey sign-in and the handoff redeem end with a conditional update of the row that they trust, on every path. When a claim took that row, the sign-in deletes its own session and answers its failure. The password sign-in and the social sign-in already did so.

    The email_verified claim of a session JWT reads the session flag with the user’s flag. publicUser, the ID token, and userinfo keep the user’s flag. The confirm of a change of address sets the flag on the session that it keeps.

    A user with no address that is not anonymous gets the flag at every sign-in, the password sign-in too. Each verified-only action still reads the user row. So a username-only user can change its password, and it makes no API token, because it holds no verified handle.

    The compat entry of core exports createApiTokenAs and createOrganizationTokenAs for a server call that names its user and has no session. They keep the rule of the user row.

  • a1c5ad8: The storage port gains an optional call, undoOnlyWhile(model, where, also). Inside a transaction, the undo of each later delete puts its rows back only while a row of model matches where. When also names a second model and where, a row must match it too. D1, the SQLite drivers, and the memory store have it on each transaction. Postgres and MySQL leave it out, because a throw there undoes the whole transaction.

    A claim of an address calls it after its lease, with the unverified user as the condition. D1 can apply a write and lose its answer. When the claim’s mark of the address lands and its answer is lost, the user stays verified, and no row of the claimant comes back. Before, the undo put back the claimant’s password, identities, and passkeys on the verified user. A claim whose mark matches no row met a user that another claim verified first. Its undo keeps the condition, so no row comes back onto the verified user.

    On a store with no isolation a claim now calls keep() right after its mark of the address. So a failure in its session delete keeps the mark and the deletes. Before, the undo put the mark back first, and then the guard put back the claimant’s password. That held even after the owner signed in by a second proof. Now the flow answers 500, and the claim stands. The flow runs none of the after points of the claim then. Each session of the claimant that stays ends at its next use.

    The storage port gains a second optional call, deleteOnlyWhile(model, where, whileModel, whileWhere). It deletes the rows that where matches only while a row of whileModel matches whileWhere. The check is a term of the delete statement, so the call sends one statement. D1, the SQLite drivers, and the memory store have it. Postgres and MySQL leave it out, because the hold of a claim orders the claims there.

    A claim uses it for each delete before its mark, with the unverified user as the condition. On D1 a claim can run past the life of its lease, and a rival claim can then take the lease and end first. The late deletes then remove nothing, so the owner keeps the rows that the rival kept. Before, the late claim deleted those rows, and its undo put them back. That undo also put back the claimant’s password when the late claim had deleted it before the rival’s mark.

    The undo of a claim’s deletes also needs the claim’s own lease, by its id and the expiry that it wrote. A claim past its lease can throw while a rival claim is between its deletes and its mark. Before, its undo put back the claimant’s password, and the rival’s mark kept it. The rival’s take of the lease, or the sweep, changes that lease row. So the undo of the late claim now puts back no row.

    The conformance suite holds each call on each store that has it. A store whose isolated is false must have both calls. Its option undoGuard holds both calls to any adapter.

    A session made before the proof ends at its next use once the proof lands, with the new reason claimed. When a session read finds an unproved session of a user with a verified address, it answers as with no session. So the request gets 401. A read that writes ends the session and fires session.afterEnd. The session JWT mint refuses such a session, and api.jwt.sessionLive answers false. So after a lost answer at the mark, the claimant keeps no session either. Before, that session could read the account, end the owner’s sessions, and delete the account.

    SessionEndReason gains claimed. A sign-in by a credential that the claim kept can read the user before the claim and write its session after it. That session ends at its next use too, and the person signs in again. A Worker of schema version 15 that runs after the migration to version 16 writes unproved sessions. Each one now ends at its next use, so deploy core at version 16 at once.

  • 108fbf5: Add the error codes body_too_large (413) and body_busy (503). Core reads at most the cap of each route of a request body, and refuses a longer body before any parse. The cap is 64 KiB, 256 KiB for the Apple callback, and 8 MiB for the two SSO connection writes. A JSON body nested deeper than 16 or with more than 4096 items answers invalid_body before the parse. A form body of more than 128 pairs gets the refusal of a bad form before the parse, at the SAML ACS too. A SCIM body nested deeper than 16 or with more than 65536 items answers 400 invalidSyntax before the parse. The body reads of the routes with a cap above 64 KiB hold at most 16 MiB at once in one isolate. A read past it answers body_busy (503) with Retry-After. The compatibility package reads each request body with core’s capped reader, at the cap of the core route of the path. Past that cap it answers PAYLOAD_TOO_LARGE (413) at its first read. Past the budget of the large reads it answers SERVICE_UNAVAILABLE (503). Before its read of an SSO connection write, it runs core’s limit of the SSO manager writes of the user. Core counts that write once. Add the error code body_timeout (408). A body read above the floor stops when it gets no bytes for 10 s. It also stops when it runs past the time of its cap at 128 KiB per second, at least 10 s. Both answer body_timeout. One client holds at most 4 MiB of the budget of the large reads, or the cap of its read when that is more. The compatibility package answers REQUEST_TIMEOUT (408). The budget has two halves of 8 MiB that do not lend bytes to each other. The large reads of signed-in users use one half, and every other large read uses the other. One IP holds at most 4 MiB of its half, and a user may hold the cap of its read. A request with no client IP takes no share of its own, and counts in the anonymous half only. A signed-in user runs one large body read at a time, and a second answers body_busy (503) before any byte. The large read of a signed-in user must arrive at 256 KiB per second or more, so an SSO connection write gets 32 s. Core allows 6 large reads of one user per hour, on the new limit sso-large-read:user, and answers rate_limited (429) past it. The compatibility package counts that limit before its own read of an SSO connection write, and core counts the write once. A request with no client IP now takes the 4 MiB share of one IP. One caller with no header cannot fill the anonymous half. ipKey gives a text that is not an IP the key text: and the text. So no header text takes the key unknown of a request with no IP. A SCIM body read that stalls answers 408 in the SCIM error form, not core’s JSON form. The Apple callback form post counts on the new limit social-callback:ip before its read, and answers rate_limited past it. The compatibility package reads each SSO connection write once. It clones a POST body only on the four password paths that read the copy. An SSO connection write whose large read cannot start answers body_busy (503) before the limits of its user, and counts on neither. A read cannot start while its user runs one, or while the user half has no room for its declared length. So a client that sends it again after Retry-After keeps its writes of the hour. The compatibility package checks the same before its own count. A write with no declared length that starts counts at its start, and can then get body_busy at its first chunk. The request event of a SCIM 503 now carries the code body_busy. The request events of a SCIM 408 and a SCIM 413 carry body_timeout and body_too_large. An SSO connection write whose large read takes more than 8 s spends the rest of its user’s window of sso-large-read:user. It spends at each end of the read: whole, 408, 413 past the cap, a 503 during the read, or a closed socket. The spend lands in the window in which the read ends. Until that window ends, both SSO connection writes of the user answer rate_limited (429) before any byte. A write that ends within 8 s spends nothing. The compatibility package spends the same at its own read.

  • 8953ed5: Breaking: a social.oauth2 entry named microsoft or discord now fails at createAuth, because each name is a preset. Use the presets social.microsoft and social.discord. A social.oidc entry with such a name fails too, and so do the names gitlab, slack, twitter, and facebook.

    The microsoft preset keys each identity on oid, the key that Better Auth keeps.

  • f9781f3: The two SSO connection writes name their row in the query. POST /sso/connections/create takes organizationId in its query, and POST /sso/connections/update takes id in its query. The body holds the other fields, and a body that carries the id answers invalid_body. So the manager guard runs before the body read. An account that manages no organization reads no large body: each of its writes to these two routes gets a refusal before any byte. The refusal is the 403 of the manager guard, or an earlier one, such as 401, 503, 429, 400, or 404. POST /sso/connections/delete reads its body first, at most 64 KiB, and then runs the manager guard. The client sends the query for you, so sso.connections.create and sso.connections.update keep their inputs. The compatibility package runs the same guard before its own read of these two paths. Before it reads /sso/register or /sso/update-provider, it checks that the caller can manage some organization.

Patch Changes

  • 7762d73: A flow that claims an unverified address counts its claim retries apart from its unique-key retry. Before, a magic link, a social sign-in, a password reset, or an invitation confirm could answer 500. That happened after one unique-key retry, two session races, and one lost claim.

    On a store with a query limit per invocation, such as D1, a claim runs once. When another proof claims the user first, the flow answers 409 conflict, and the undo leaves no write of the claim. The reset and the invitation confirm keep their link, so the client can send the same request again. Before, one session race on D1 could pass 50 queries, answer 500, and keep writes of the claim.

    A ban by a platform operator reads the platform role of its target again inside its transaction. A grant of the platform role now locks the organization before it counts membersPerOrganization. On a store that locks rows, such as Postgres and MySQL, these steps close two races. A grant that commits after the first read of the ban makes the ban answer operator_required. Two grants at the limit add one member row, not two. D1 and the SQLite adapter have no row lock, so there the second read and the lock do not close these races. On D1 the tests check only the query count of each act.

    On a store with a query limit per invocation, such as D1, the account delete reads the user’s scimUser rows before its size check. It keeps one query for each chunk of 50 rows past the first. So a user with scimUser rows in more than 50 organizations can delete inside 50 queries. A delete whose chunks do not fit the budget answers delete_too_large before any delete.

    The size check of an account delete now counts each read that it sends. Before, it counted 3 reads of the organization rule, but a user with 51 to 100 memberships costs 5. So such a delete on D1 could pass the 50 calls of one invocation.

  • e239c83: On a storage whose user delete cascades, an account delete now records the impersonation sessions that the cascade ends. Each storage of the compatibility package is such a storage. Before, the cascade took the sessions past the page of the delete, and no impersonation_stop row recorded their end.

    With the impersonation tool on, the delete reads the user’s live impersonation sessions before its page. The pending-end row of the delete names those that the page does not end, with the time of the delete. The sweep writes their impersonation_stop rows from its next run, one storage call each, in pages inside its call budget. Each such row holds endedAt in data, the time of the delete. operator.afterAction gets each row after the commit of the sweep.

    On a storage with no row lock, another flow can end such a session after the read of the delete. That flow writes the stop row. So the sweep first reads the user’s stop rows from 5 s before the delete, at most the newest 200. That read is one storage call for each pending-end row with such sessions. The sweep writes no second row for a session that one of these rows names.

    A delete of a user with more than 100 live impersonation sessions on such a storage answers 409 delete_too_large, and changes nothing.

    The read of the delete costs one storage call, and the size check of the delete counts it. On the D1 storage of the compatibility package with the tool on, a secret with the scope delete now takes fewer organizations. The delete of a user with no solo organization and 4 organizations that the user owns with another owner answers delete_too_large. Before this change, and with the tool off, that delete fits.

  • 552820d: A mailbox proof is final. A claim of an unverified address keeps its writes once its last write is done. When the flow fails after that point, the address stays verified and the rows that the claim deleted stay deleted. The flow still answers its error, and it first runs user.afterVerify, session.afterEnd with reason claim, and operator.afterAction for each stop row. On Postgres and MySQL such a failure undoes the whole claim, so no after point runs. Before, on D1 such a failure undid the claim after another proof had read the verified flag. Then a reset could answer 200 and leave the user unverified. After a final claim, an identity that a parallel proof of the same user wrote first counts as present, and the flow signs in.

    A session that another request ends during a claim no longer undoes the claim. The claim ends the other sessions, and fires session.afterEnd only for the sessions that it ended. Before, on D1 a sign-out at that moment made the flow answer 409 conflict.

    On D1, a store with a query limit per invocation, a magic link or an email code can lose its claim to another proof. It then answers 409 conflict and mails a new proof of the same kind to the address. The mail counts on the per-address mail limit of its kind, so a loop of races sends at most that limit. A failure of that mail leaves the 409 and emits claim.mail_failed. A sign-up confirm that loses its claim mails nothing, because the address is verified. A JSON caller gets the 409 with a detail that says to sign in. The form post of the mail link gets a redirect to the app with auth_error=conflict. A social sign-in and an ID-token sign-in send no mail. The other stores run the claim again, and the flow answers as for a verified user.

  • f82781f: A SCIM write that stops with the code conflict answers 409 in the SCIM error message with no scimType. The detail is “Another request changed this resource at the same time. Send the request again.” Before, the detail was the bare code conflict. A lost claim, an account delete of the user during the write, and a lost lock of the user row stop with this code. On a store with a query limit per invocation, such as D1, a SCIM create can lose a claim race to another proof. A resend can pass, so the directory sends the same request again. A write that loses each of its rounds keeps its own detail. A value in use, such as the userName of another User, still answers 409 uniqueness.

    Before, a SCIM write at the member limit answered the bare code member_limit as its detail. The new detail is “The organization is at its member limit.”

  • 48a2484: Each package names its Node floor in engines and lists CHANGELOG.md in files. The floor is Node 22, or the higher floor that the package already had.

  • ba9405b: Core and the MCP server answer the version of their own package. This value is in GET /operator/info, in the OpenAPI document, and in the server info and the version tool of the MCP server. The build writes it from package.json, so it changes with each release.

  • 48a2484: Core and the client declare vitest as an optional peer dependency. Their conformance kits import vitest, so a kit now loads in the test run of an adapter, a limiter, or an SDK. An app that does not run a kit installs nothing new.

  • d3cc382: Security: Take zod 4.6.6 in core and the MCP server. zod below 4.6.6 can exhaust memory when it validates an oversized constrained collection (GHSA-mrhx-c7xc-m3w5).

The changelog of each other package:

The feed /feed.xml has one entry for each release of each package. A feed reader shows each new release.

A changelog is a record. changeset version writes each section from the changesets of the release. No later change edits a released section. A fault in an old section gets a correction in the next section. The release check check-records fails on an edit of a released section.