Accounts 1.1.0: moving Events' users in, people.* requests, new recovery codes

POST /api/accounts/v1/requests (crosscode.identity-request/1): import.* keeps
each person's Events id as sub, password hash and authenticator secret
(sealed in transit), consent, notices and lockout; linked when the email
already has an account. people.* for product admins, limited to people the
product knows. New recovery codes after the first 2FA sign-in for people
moved in with 2FA. screen=signup. auth-client: request(), seal(), signUp.
8 new tests (47 in all).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 13:40:15 +02:00
co-authored by Claude Opus 5.5
parent 08fef930c1
commit 733992e917
19 changed files with 834 additions and 39 deletions
@@ -68,6 +68,8 @@ export async function createProvider(ctx: Ctx): Promise<Provider> {
adapter: adapterFor(ctx),
clients: [selfClient(ctx)],
extraClientMetadata: { properties: ['crosscode.product'] },
// 1.1.0: `screen=signup` opens the sign-in page on "Create an account".
extraParams: ['screen'],
clientDefaults: { id_token_signed_response_alg: 'ES256', grant_types: ['authorization_code'], response_types: ['code'], token_endpoint_auth_method: 'client_secret_basic' },
findAccount: async (_k, sub) => {
const a = await ctx.db.account.findUnique({ where: { id: sub } });