Password auth broken on next: better-auth 1.7.1 requires accounts.issuer column missing from @mosaicstack/db schema #1395

Closed
opened 2026-08-24 21:39:56 +00:00 by orch-01 · 1 comment
Contributor

With ALL deps aligned at -next.2636, better-auth 1.7.1 core credential flow reads and writes account.issuer (sign-up.mjs:246 writes local:credential via createLocalAccountIssuer; sign-in.mjs:319 filters on issuer), but the @mosaicstack/db schema.js accounts table has no issuer column.

Result: signup 500 BetterAuthError, sign-in 401 for every user, on every fresh next install.

Local fix verified on web1: add issuer text('issuer') to schema.js accounts, ALTER TABLE accounts ADD COLUMN issuer text, backfill 'local:credential' on provider_id='credential' rows; then sign-in 200 with session token and admin role.

That local fix is a dist patch reverted by any reinstall; needs the schema column plus a migration upstream.

Severity: HIGH, blocks all password auth on next.

Reported by usc/fred during T63 greenfield deployment (web1, Debian, gateway@next 0.0.7-next.2636). Filed by orch-01. Tag: T63 batch 2.

With ALL deps aligned at -next.2636, better-auth 1.7.1 core credential flow reads and writes account.issuer (sign-up.mjs:246 writes local:credential via createLocalAccountIssuer; sign-in.mjs:319 filters on issuer), but the @mosaicstack/db schema.js accounts table has no issuer column. Result: signup 500 BetterAuthError, sign-in 401 for every user, on every fresh next install. Local fix verified on web1: add issuer text('issuer') to schema.js accounts, ALTER TABLE accounts ADD COLUMN issuer text, backfill 'local:credential' on provider_id='credential' rows; then sign-in 200 with session token and admin role. That local fix is a dist patch reverted by any reinstall; needs the schema column plus a migration upstream. Severity: HIGH, blocks all password auth on next. Reported by usc/fred during T63 greenfield deployment (web1, Debian, gateway@next 0.0.7-next.2636). Filed by orch-01. Tag: T63 batch 2.
orch-01 added the bug label 2026-08-24 21:39:56 +00:00
Member

PR #1401 carries the fix. One decision this issue owns separately from the fix: the lockfile resolves better-auth to 1.5.5 while the declared range ^1.5.5 admits 1.7.1 on fresh resolution — that gap is exactly why the defect fires on greenfield installs and not on lockfile-respecting ones. Pin-vs-range needs its own owner and its own change (pinning affects every workspace consumer; widening the lockfile deliberately to 1.7.x would make the issuer column load-bearing for THIS repo's tests too). The PR makes the schema correct under both versions either way. Credit: found by T63 on web1 greenfield; root cause and verified dist-patch by fred.

PR #1401 carries the fix. One decision this issue owns separately from the fix: the lockfile resolves better-auth to 1.5.5 while the declared range ^1.5.5 admits 1.7.1 on fresh resolution — that gap is exactly why the defect fires on greenfield installs and not on lockfile-respecting ones. Pin-vs-range needs its own owner and its own change (pinning affects every workspace consumer; widening the lockfile deliberately to 1.7.x would make the issuer column load-bearing for THIS repo's tests too). The PR makes the schema correct under both versions either way. Credit: found by T63 on web1 greenfield; root cause and verified dist-patch by fred.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1395