[www] password/email recovery (#146)

* pw/email recovery

* fix migration
This commit is contained in:
devin
2026-10-27 23:49:52 -04:00
committed by GitHub
parent fd30182f3d
commit cc14c208b2
31 changed files with 4104 additions and 539 deletions
+11
View File
@@ -0,0 +1,11 @@
-- Fixed-window counters: "at most N of these per key per window". What caps the emails
-- this server sends — password-recovery codes (`auth`) and email-change codes (`accounts`)
-- — per target account and per requesting IP, so a mailbox can't be flooded by anyone who
-- knows its address. Mirrored by RATE_LIMIT_SCHEMA_DDL in @repo/domain's rate-limit-db.ts,
-- which says how a key is taken and when rows are purged.
CREATE TABLE IF NOT EXISTS rate_limit (
key TEXT PRIMARY KEY,
window_started_at INTEGER NOT NULL,
count INTEGER NOT NULL
);