LoginForm mapped every signIn failure to one generic sentence. Better Auth
returns distinct codes in signIn order — password check, then
requireEmailVerification (EMAIL_NOT_VERIFIED), then the session.create.before
hook canCreateSession (FAILED_TO_CREATE_SESSION). Map those to specific
messages: unverified email, not-yet-approved account, invalid credentials.
canCreateSession returns true only for ADMIN or editorial status 'active', and
onEmailVerified → markPendingApproval leaves verified editorials at
pending_approval until an admin approves — so the not-approved message is the
common post-verification login block.
Co-Authored-By: Claude <noreply@anthropic.com>
Better Auth's default id generator emits a nanoid-style string, but
every id column in the schema is typed uuid. Better Auth passes its
generated id explicitly on insert (bypassing the column defaultRandom),
so Postgres rejected every signUp/session/verification insert with
'invalid input syntax for type uuid'. This broke live registration and
the admin seed alike. Configure advanced.database.generateId to return
crypto.randomUUID() so ids match the schema.
Co-Authored-By: Claude <noreply@anthropic.com>
- Wire admin approval UI to editorialService.approveEditorial so editorial
accounts can move pending_approval -> active and log in. The approve button
was permanently disabled and the service unreachable, so editorial users
could never sign in.
- Surface non-validation errors (e.g. SMTP failures) on the registration
form instead of silently redirecting to the confirmation page.
- Set BETTER_AUTH_URL default to the production domain in .env.example and
compose.yaml so verification/reset links and the login origin check
resolve against the live origin.
- Add scripts/check-smtp.ts to verify SMTP connectivity against the
configured transport.
Co-Authored-By: Claude <noreply@anthropic.com>
- Revert packageManager from pnpm@11.16.0 back to pnpm@10.34.5
(restore the plan's pinned version; the PATH pnpm is unaffected).
- Inject a deterministic PDFKit document /ID derived from
SHA-256(snapshot.documentId) so the same snapshot always produces
byte-identical output, making the stored SHA-256 a verifiable
integrity fingerprint.
- Add covering test: render same fixture twice, assert bytes.equals()
and sha256 equality.
Co-Authored-By: Claude <noreply@anthropic.com>