Skip to content

Commit 781e0f7

Browse files
[7.0] Cleanup legacy code paths
1 parent 2bfec7f commit 781e0f7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* Add argument `$badgeFqcn` to `Passport::addBadge()`
88
* Add argument `$lifetime` to `LoginLinkHandlerInterface::createLoginLink()`
9+
* Throw when calling the constructor of `DefaultLoginRateLimiter` with an empty secret
910

1011
6.4
1112
---

RateLimiter/DefaultLoginRateLimiter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpFoundation\RateLimiter\AbstractRequestRateLimiter;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\RateLimiter\RateLimiterFactory;
17+
use Symfony\Component\Security\Core\Exception\InvalidArgumentException;
1718
use Symfony\Component\Security\Http\SecurityRequestAttributes;
1819

1920
/**
@@ -36,8 +37,7 @@ final class DefaultLoginRateLimiter extends AbstractRequestRateLimiter
3637
public function __construct(RateLimiterFactory $globalFactory, RateLimiterFactory $localFactory, #[\SensitiveParameter] string $secret = '')
3738
{
3839
if ('' === $secret) {
39-
trigger_deprecation('symfony/security-http', '6.4', 'Calling "%s()" with an empty secret is deprecated. A non-empty secret will be mandatory in version 7.0.', __METHOD__);
40-
// throw new \Symfony\Component\Security\Core\Exception\InvalidArgumentException('A non-empty secret is required.');
40+
throw new InvalidArgumentException('A non-empty secret is required.');
4141
}
4242
$this->globalFactory = $globalFactory;
4343
$this->localFactory = $localFactory;

0 commit comments

Comments
 (0)