Better Auth rate limit writes a row per auth request #175

Open
opened 2026-11-08 18:18:01 +00:00 by chris-kreidl · 1 comment
chris-kreidl commented 2026-11-08 18:18:01 +00:00 (Migrated from github.com)

(session 27) Better Auth now counts in the rateLimit table, so every /api/auth/* request reads and writes a row (sign-in, passkey list, sign-out; not getSession inside server functions). Fine at one user. The limiter is on only when NODE_ENV=production (Vercel sets it; a local bun run start does not).

Moved from docs/PROGRESS.md → Follow-ups → Later on 2026-11-08.

(session 27) Better Auth now counts in the `rateLimit` table, so every `/api/auth/*` request reads and writes a row (sign-in, passkey list, sign-out; not `getSession` inside server functions). Fine at one user. The limiter is on only when `NODE_ENV=production` (Vercel sets it; a local `bun run start` does not). _Moved from docs/PROGRESS.md → Follow-ups → Later on 2026-11-08._
chris-kreidl commented 2026-11-08 20:17:11 +00:00 (Migrated from github.com)

What this is about. Better Auth's rate limiter stores its counts in the database (rateLimit table), so every /api/auth/* request (sign-in, passkey list, sign-out) reads and writes a row. It's only on in production (NODE_ENV=production, which Vercel sets; a local bun run start doesn't).

Status (checked 2026-11-08): unchanged, and fine at this scale.

Keep as: a note. It only matters with many users, and then the move is a memory or KV store.

**What this is about.** Better Auth's rate limiter stores its counts in the database (`rateLimit` table), so every `/api/auth/*` request (sign-in, passkey list, sign-out) reads and writes a row. It's only on in production (`NODE_ENV=production`, which Vercel sets; a local `bun run start` doesn't). **Status (checked 2026-11-08):** unchanged, and fine at this scale. **Keep as:** a note. It only matters with many users, and then the move is a memory or KV store.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/trainer#175
No description provided.