feat(auth): password change (self + admin reset) with rate limiting; dedupe watchlist to user menu
Build & Push Docker Image / build (push) Successful in 2m19s

This commit is contained in:
opencode
2026-08-03 07:43:24 +02:00
parent 63f0bdbab6
commit 68a81ec775
20 changed files with 825 additions and 16 deletions
@@ -0,0 +1,19 @@
import rateLimit from "express-rate-limit";
import type { Request } from "express";
export const loginRateLimit = rateLimit({
windowMs: 60 * 1000,
limit: 10,
standardHeaders: "draft-7",
legacyHeaders: false,
message: { error: "Too many login attempts, please try again later." },
});
export const passwordRateLimit = rateLimit({
windowMs: 60 * 1000,
limit: 5,
standardHeaders: "draft-7",
legacyHeaders: false,
keyGenerator: (req: Request): string => String(req.session.user?.sub ?? req.ip ?? "unknown"),
message: { error: "Too many password attempts, please try again later." },
});