Skip to content

feat(enrollment): add schemas for tracking and inviting passkey enrollment - #87

Merged
Bccorb merged 2 commits into
mainfrom
feat/enrollment-tracking
Oct 6, 2026
Merged

Bccorb merged 2 commits into
mainfrom
feat/enrollment-tracking

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Part of fells-code/seamless-auth-api#338 (epic fells-code/seamless-auth-api#334).

After an import, the remaining work is getting everyone onto a passkey, ideally two authenticators each. These are the schemas for seeing who has enrolled and for inviting the rest.

Changes

  • Enrollment list:
    • EnrollmentStatusSchema (none, one, two_or_more), counted in WebAuthn credentials. TOTP does not count.
    • AdminEnrollmentQuerySchema: pagination, plus organizationId, status, imported and search.
    • AdminEnrollmentResponseSchema: a per-status summary that ignores the status filter, the filtered users, and total. This also feeds the coverage report in #178.
  • Invites:
    • EnrollmentInviteRequestSchema takes exactly one of userIds (up to 200) or organizationId, plus status (none or one, default none) and an optional signInUrl validated like other redirect targets.
    • EnrollmentInviteResponseSchema reports sent, skipped, remaining (organization-wide calls only) and a result per user, with a skip reason and an external delivery.
    • The invite is a notice that links to the normal sign-in page. It carries no credential.
  • AuthDeliverySchema: new enrollment_invite_email kind (to, signInUrl), for external delivery mode.
  • AUTH_EVENT_TYPES: admin_enrollment_invite_sent.
  • SystemConfigSchema.prompt_passkey_enrollment (default false), also patchable. With it set, email or phone code sign-ins (OTPVerifyTokenSuccessSchema) and magic link sign-ins (MagicLinkPollSuccessSchema) carry nextStep: 'enroll_passkey' for a user with no passkey. That is what sends an invited user into enrollment after they sign in.
  • NextStepSchema is now shared with OAuthLoginSuccessResponseSchema.

Downstream

Checks

npm run typecheck, npm run lint, npm run format:check, npm test (276, 11 new) and npm run build pass.

@Bccorb
Bccorb merged commit 8bd5f71 into main Oct 6, 2026
1 check passed
@Bccorb
Bccorb deleted the feat/enrollment-tracking branch October 6, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant