fix(enterprise): verify invited owner on acceptance

Merged
IC
2mo ago
+190-22

Summary

  • let a newly created, unverified account review its securely tokenized Enterprise owner claim
  • verify the canonical account email inside the same transaction that accepts ownership and enqueues activation
  • keep claim GET read-only so email scanners cannot verify or activate the account
  • retain exact token, session-email, current account-email, membership, workspace, invitation, and seat validation

Testing

  • bunx vitest run lib/billing/enterprise-owner-claim.test.ts app/api/enterprise-owner-claims/[id]/route.test.ts
  • bun run type-check (apps/sim)
  • scoped Biome check
  • bun run check:api-validation