feat(auth): add password reset and recovery flow

This commit is contained in:
Anthony Ettinger 2026-10-29 13:20:27 +00:00
parent e60d31a1b4
commit 2c65baecbb
6 changed files with 184 additions and 18 deletions

View file

@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS password_resets (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token_hash TEXT NOT NULL UNIQUE,
created_at INTEGER NOT NULL,
expires_at INTEGER NOT NULL,
used_at INTEGER
);
CREATE INDEX IF NOT EXISTS idx_password_resets_user ON password_resets(user_id);
CREATE INDEX IF NOT EXISTS idx_password_resets_expiry ON password_resets(expires_at);