Skip to content

Commit 19005ec

Browse files
committed
feature #38257 [RateLimiter] Add limit object on RateLimiter consume method (Valentin, vasilvestre)
This PR was merged into the 5.2-dev branch. Discussion ---------- [RateLimiter] Add limit object on RateLimiter consume method | Q | A | ------------- | --- | Branch? | master (should be merged in 5.2 before 31 September if possible) | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #38241 | License | MIT | Doc PR | Not yet :/ <!-- https://github.com/symfony/symfony-docs/pull/X --> Commits ------- 8f62afc5f9 [RateLimiter] Return Limit object on Consume method
2 parents 9dded72 + 36c3162 commit 19005ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EventListener/LoginThrottlingListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function checkPassport(CheckPassportEvent $event): void
4848
$limiterKey = $this->createLimiterKey($username, $request);
4949

5050
$limiter = $this->limiter->create($limiterKey);
51-
if (!$limiter->consume()) {
51+
if (!$limiter->consume()->isAccepted()) {
5252
throw new TooManyLoginAttemptsAuthenticationException();
5353
}
5454
}

0 commit comments

Comments
 (0)