fix: harden booking and meeting flows

This commit is contained in:
2026-09-17 02:42:27 +02:00
parent cb30ecade9
commit 66710fc65c
42 changed files with 683 additions and 608 deletions
+9
View File
@@ -0,0 +1,9 @@
import { checkRateLimit, getClientIp } from "./rateLimit";
/** Shared budgets for registration, email changes and resend (REST and GraphQL). */
export function allowVerificationEmail(request: { headers: Headers }, email: string, customerId?: string | number): boolean {
const windowMs = 60 * 60 * 1000;
return checkRateLimit(`verification:ip:${getClientIp(request)}`, { max: 10, windowMs }) &&
(customerId === undefined || checkRateLimit(`verification:customer:${customerId}`, { max: 3, windowMs })) &&
checkRateLimit(`verification:email:${email.trim().toLowerCase()}`, { max: 3, windowMs });
}