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

Commit

Permalink
feat(logins): Count rate-limited login attempts as failed logins.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk authored and vladikoff committed Apr 4, 2016
1 parent e56bb5a commit 4761653
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ip_record.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ module.exports = function (BLOCK_INTERVAL_MS, IP_RATE_LIMIT_INTERVAL_MS, IP_RATE
}
}

// Throttle password-checking attempts if too many failed logins
// Throttle password-checking attempts if too many failed logins.
// Rate-limited login attempts still count towards your quota.
if (actions.isPasswordCheckingAction(action)) {
if (this.isOverBadLogins() && !this.isRateLimited()) {
if (this.isRateLimited()) {
this.addBadLogin()
} else if (this.isOverBadLogins()) {
this.addBadLogin()
this.rateLimit()
}
}
Expand Down

0 comments on commit 4761653

Please sign in to comment.