ADR-007: Authentication with Better Auth

Status: Accepted Date: 2026-10-10

Context

Children aged 5–10 cannot manage passwords or email. Teachers and school admins will expect single sign-on. The organization model of ADR-005 needs membership and roles.

Decision

Use Better Auth, running inside apps/api with its data in Coipe's PostgreSQL. Its organization plugin provides memberships and roles, and its sso plugin will provide OIDC and SAML for staff later. Students have no email and no password: teachers create and manage their accounts, and students sign in with a low-friction method chosen in Open items #1.

Alternatives considered

  • Clerk or WorkOS: excellent, but a monthly cost and student identities outside Coipe's database.
  • Writing auth from scratch: unjustified risk.

Consequences

  • No child's email address is ever collected.
  • The student sign-in method is a small custom Better Auth plugin.