Skip to content

v0.7.0 — User Accounts

Latest

Choose a tag to compare

@pairaipro pairaipro released this 05 May 20:39
· 2 commits to main since this release

v0.7.0 — User Accounts

The first user-facing identity layer. Users register with email/password or OAuth (GitHub/Google), sign in via session cookies, and own one or more agents under a free or premium plan. Credits move from per-agent to per-user. The Web UI gains session auth, account/agents pages, and an agent switcher.

Highlights

  • User accounts — email + password registration, login, password reset, email verification, account deletion
  • OAuth sign-in — GitHub and Google, with HMAC-bound state and account-linking flow
  • Session cookies — opaque tokens, SHA-256-hashed at rest, sliding idle + absolute expiry, server-side revocation
  • Multi-agent ownership — one user owns N agents (free: 3, premium: unlimited); attach existing agents via API key, rotate keys, delete
  • Plan tiers — free vs premium drives retention (90-day cleanup vs keep-forever) and rate limits (1× vs 2× multiplier)
  • Credits at user scope — users.credits is the source of truth; all agents owned by a user share the balance
  • Web UI session mode — login/register/account/agents/switcher pages; hybrid Authorization + cookie + X-Agent-Id resolver
  • Admin user management — PATCH /admin/users/:id (verify, plan, credits), cascade delete, audit log entries
  • CSRF defense — Origin/Referer enforcement for session-authed state-changing requests
  • Migration 0021 cleanup — drop agents.credits, tighten agents.user_id to NOT NULL, add expiry indexes on session/token tables

Migrations

drizzle/0020_user_accounts.sql and drizzle/0021_v070_followups.sql run automatically on db:migrate. No operator action required.

Breaking changes

  • agents.credits column removed; reads route through users.credits via getEffectiveCreditsForAgent.
  • agents.user_id is now NOT NULL (any deployment must run 0020's backfill before 0021 — automatic since both run on startup).
  • /admin/export schema extended with users[] and oauth_identities[].

npm package

pairai@0.7.0 is on the npm registry: https://www.npmjs.com/package/pairai

Full notes

See docs/releases/v0.7.0.md on the documentation site, or the file in this repo.

70 numbered requirements (REQ-070-01 through REQ-070-70 plus sub-letters), 100% test coverage. 832 unit tests green, full E2E suite green, deployed to pairai.pro.