Skip to content

Commit

Permalink
Merge pull request #33157 from nextcloud/backport/33153/stable24
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Jul 8, 2022
2 parents 09d6d02 + d306757 commit dec16a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/private/Security/Bruteforce/Throttler.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class Throttler {
private LoggerInterface $logger;
/** @var IConfig */
private $config;
/** @var bool */
private $hasAttemptsDeleted = false;
/** @var bool[] */
private $hasAttemptsDeleted = [];

public function __construct(IDBConnection $db,
ITimeFactory $timeFactory,
Expand Down Expand Up @@ -225,7 +225,7 @@ public function getAttempts(string $ip, string $action = '', float $maxAgeHours
$maxAgeHours = 48;
}

if ($ip === '' || $this->hasAttemptsDeleted) {
if ($ip === '' || isset($this->hasAttemptsDeleted[$action])) {
return 0;
}

Expand Down Expand Up @@ -303,7 +303,7 @@ public function resetDelay(string $ip, string $action, array $metadata): void {

$qb->executeStatement();

$this->hasAttemptsDeleted = true;
$this->hasAttemptsDeleted[$action] = true;
}

/**
Expand Down

0 comments on commit dec16a9

Please sign in to comment.