audit: harden better-auth config, fix types, cleanup
- Fix email verification link using Better Auth's url parameter (was hardcoded to google.com) - Make App.Locals session/user types nullable to match reality - Add explicit rate limiting config (60s window, 100 max) - Add trusted origins for localhost:5173 and production domain - Add Forgot Password? and Register links to login page - Remove unused dead code from auth-client.ts - Remove outdated known-bug note from AGENTS.md (register redirect is fixed)
This commit is contained in:
@@ -31,7 +31,6 @@ Requires `.env` with at least `DATABASE_URL`, `BETTER_AUTH_SECRET`, `BETTER_AUTH
|
||||
- **`expect: { requireAssertions: true }`** — every test must assert something.
|
||||
- **All route tests mock `$lib/db`** (Prisma client) and `$lib/auth-client`/`$lib/auth` via `vi.mock()`. Stub factories in `src/lib/test-utils.ts`.
|
||||
- **No `.env.test`** — mocking `$lib/db` makes real DB unnecessary.
|
||||
- **Known bug**: register page `throw redirect()` is caught by try/catch and returns 400 instead of redirecting (documented in test).
|
||||
|
||||
## Architecture notes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user