We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fad36e commit 654a5edCopy full SHA for 654a5ed
src/node/routes/login.ts
@@ -12,8 +12,8 @@ import i18n from "../i18n"
12
// RateLimiter wraps around the limiter library for logins.
13
// It allows 2 logins every minute plus 12 logins every hour.
14
export class RateLimiter {
15
- private readonly minuteLimiter = new Limiter(2, "minute")
16
- private readonly hourLimiter = new Limiter(12, "hour")
+ private readonly minuteLimiter = new Limiter({ tokensPerInterval: 2, interval: "minute" })
+ private readonly hourLimiter = new Limiter({ tokensPerInterval: 12, interval: "hour" })
17
18
public canTry(): boolean {
19
// Note: we must check using >= 1 because technically when there are no tokens left
0 commit comments