diff --git a/src/Illuminate/Cache/RateLimiter.php b/src/Illuminate/Cache/RateLimiter.php index 5bd79fdaf3e8..1de6ac8169ec 100644 --- a/src/Illuminate/Cache/RateLimiter.php +++ b/src/Illuminate/Cache/RateLimiter.php @@ -32,10 +32,9 @@ public function __construct(Cache $cache) * * @param string $key * @param int $maxAttempts - * @param float|int $decayMinutes * @return bool */ - public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1) + public function tooManyAttempts($key, $maxAttempts) { if ($this->attempts($key) >= $maxAttempts) { if ($this->cache->has($key.':timer')) { diff --git a/src/Illuminate/Foundation/Auth/ThrottlesLogins.php b/src/Illuminate/Foundation/Auth/ThrottlesLogins.php index 8ba6e289669c..5235299faa30 100644 --- a/src/Illuminate/Foundation/Auth/ThrottlesLogins.php +++ b/src/Illuminate/Foundation/Auth/ThrottlesLogins.php @@ -20,7 +20,7 @@ trait ThrottlesLogins protected function hasTooManyLoginAttempts(Request $request) { return $this->limiter()->tooManyAttempts( - $this->throttleKey($request), $this->maxAttempts(), $this->decayMinutes() + $this->throttleKey($request), $this->maxAttempts() ); } diff --git a/src/Illuminate/Routing/Middleware/ThrottleRequests.php b/src/Illuminate/Routing/Middleware/ThrottleRequests.php index a448ced1e726..1050b6669c4a 100644 --- a/src/Illuminate/Routing/Middleware/ThrottleRequests.php +++ b/src/Illuminate/Routing/Middleware/ThrottleRequests.php @@ -48,7 +48,7 @@ public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes $maxAttempts = $this->resolveMaxAttempts($request, $maxAttempts); - if ($this->limiter->tooManyAttempts($key, $maxAttempts, $decayMinutes)) { + if ($this->limiter->tooManyAttempts($key, $maxAttempts)) { throw $this->buildException($key, $maxAttempts); } diff --git a/tests/Cache/CacheRateLimiterTest.php b/tests/Cache/CacheRateLimiterTest.php index 250cafa6629f..2e134b1bf42b 100644 --- a/tests/Cache/CacheRateLimiterTest.php +++ b/tests/Cache/CacheRateLimiterTest.php @@ -22,7 +22,7 @@ public function testTooManyAttemptsReturnTrueIfAlreadyLockedOut() $cache->shouldReceive('add')->never(); $rateLimiter = new RateLimiter($cache); - $this->assertTrue($rateLimiter->tooManyAttempts('key', 1, 1)); + $this->assertTrue($rateLimiter->tooManyAttempts('key', 1)); } public function testHitProperlyIncrementsAttemptCount()