Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(logins): combine limiting for bad logins and rate
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikoff committed Apr 4, 2016
1 parent 8d94c1c commit 2f0aa17
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/ip_record.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,11 @@ module.exports = function (BLOCK_INTERVAL_MS, IP_RATE_LIMIT_INTERVAL_MS, IP_RATE
// Throttle password-checking attempts if too many failed logins.
// Rate-limited login attempts still count towards your quota.
if (actions.isPasswordCheckingAction(action)) {
if (this.isRateLimited()) {
if (this.isRateLimited() || this.isOverBadLogins()) {
// attempt a password-checking action leads to a bad attempt
this.addBadLogin()
// we also re-rate-limit this attempt
this.rateLimit()
} else if (this.isOverBadLogins()) {
this.rateLimit()
}
}

Expand Down

0 comments on commit 2f0aa17

Please sign in to comment.