brackt/app
Chris Parsons 5268e07365
Migrate auth from Clerk to BetterAuth (#354)
* Fix BetterAuth field mapping and add owner-prefixed team names

- Fix auth.server.ts: use camelCase Drizzle field names for BetterAuth
  adapter (was snake_case, causing user inserts to fail); add
  generateId: "uuid" so PostgreSQL UUID columns accept generated IDs
- Add prependOwnerToTeamName / stripOwnerFromTeamName utilities
- Invite join, league creation, and settings assign/remove all now
  manage the owner-prefix on team names atomically

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Complete BetterAuth migration: auth flows, rename, and cleanup

- Add /forgot-password and /reset-password pages (full password reset flow)
- Add 'Forgot password?' link on login page
- Fix register.tsx: add explicit window.location fallback after signUp
- Rename commissionerAuditLog.actorClerkId → actorUserId (migration 0084)
  and update all references in model, routes, components, and tests
- Rewrite docs/agents/auth.md to document BetterAuth (removes all Clerk refs)
- Update test fixtures and schema comments to remove Clerk ID references;
  use UUID-format IDs throughout test data
- Update docs/agents/domain-models.md ownerId description

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix BetterAuth ID generation, clean up review issues

- Set generateId: false so BetterAuth omits id from inserts; add
  $defaultFn(crypto.randomUUID) to accounts/sessions/verifications
  so Drizzle fills it in (fixes null id constraint violation on signup)
- Move renameTeam to static import; rename before removeTeamOwner so
  a failed rename leaves owner intact rather than leaving a stale prefix
- Clarify stripOwnerFromTeamName toTitleCase assumption in comment
- Annotate reset-password token fallback to explain loader guarantee

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 10:03:50 -07:00
..
components Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
contexts feat: implement middleware and context provider for Express integration 2025-10-11 20:56:00 -07:00
hooks Add overnight pause for draft timers (#335) 2026-04-26 22:31:52 -07:00
lib Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
models Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
routes Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
services Add projected-wins input mode to admin Elo Ratings page (#306) 2026-04-17 12:40:08 -07:00
test Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
types Redesign standings page with sortable table, 7-day change, and chart repositioned (#205) 2026-03-22 11:05:13 -07:00
utils Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
welcome Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
app.css Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
entry.client.tsx Filter unnecessary sentry css and js errors. 2026-03-15 10:24:57 -07:00
entry.server.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
root.tsx Fix admin navbar link: use isUserAdmin DB call instead of session.user.isAdmin 2026-04-24 23:10:03 -07:00
routes.ts Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00