Skip to content

Commit 9d989a5

Browse files
committed
minor #19354 [Security] Fixing PHP example for limiting login attempts with rate limiter (MirakuSan)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Security] Fixing PHP example for limiting login attempts with rate limiter After struggling with the rate limiter on my app. I think the PHP example for « limiting login attempts » with a rate limiter has a bad copy/paste for the third option to pass to the container to register the `DefaultLoginRateLimiter::class`. Using `new Reference('kernel.secret')` , I had an error telling me `No services 'kernel.secret' found` Here is what I used and worked for me and so it is my proposal 🙏 Commits ------- 40227c9 [Security] Fixing PHP example for limiting login attempts with rate limiter
2 parents 161b871 + 40227c9 commit 9d989a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ and set the ``limiter`` option to its service ID:
16531653
<!-- 2nd argument is the limiter for username+IP -->
16541654
<srv:argument type="service" id="limiter.username_ip_login"/>
16551655
<!-- 3rd argument is the app secret -->
1656-
<srv:argument type="service" id="%kernel.secret%"/>
1656+
<srv:argument type="string">%kernel.secret%</srv:argument>
16571657
</srv:service>
16581658
</srv:services>
16591659
@@ -1697,7 +1697,7 @@ and set the ``limiter`` option to its service ID:
16971697
// 2nd argument is the limiter for username+IP
16981698
new Reference('limiter.username_ip_login'),
16991699
// 3rd argument is the app secret
1700-
new Reference('kernel.secret'),
1700+
param('kernel.secret'),
17011701
]);
17021702
17031703
$security->firewall('main')

0 commit comments

Comments
 (0)