AI Implementation feature(873): Landing Page and Login/Register Modal 1.01 (#13)

This commit was merged in pull request #13.
This commit is contained in:
2026-07-21 21:19:40 +00:00
parent cd97e40030
commit 8dc8cee769
7 changed files with 104 additions and 60 deletions
@@ -18,4 +18,15 @@ export class RegistrationRateLimitService {
arr.push(now);
this.hits.set(ip, arr);
}
}
tryConsume(ip: string, now: number = Date.now()): boolean {
const arr = (this.hits.get(ip) ?? []).filter((t) => now - t < WINDOW_MS);
if (arr.length >= MAX_PER_WINDOW) {
this.hits.set(ip, arr);
return false;
}
arr.push(now);
this.hits.set(ip, arr);
return true;
}
}