Skip to content

[Security] Fixing PHP example for limiting login attempts with rate limiter #19354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

MirakuSan
Copy link

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 🙏

@xabbuh
Copy link
Member

xabbuh commented Dec 30, 2023

Good catch @MirakuSan 👍 Can you please update the XML example as well (i.e. change line 1656 to <srv:argument type="string">%kernel.secret%</srv:argument>)?

@MirakuSan
Copy link
Author

MirakuSan commented Dec 30, 2023

yeap @xabbuh, I'll do this asap! 🙏

Edit: Done ✅

@javiereguiluz javiereguiluz force-pushed the fix/typo-php-example-limiting-login-attempts branch from 43b17c2 to 40227c9 Compare January 2, 2024 07:36
@javiereguiluz
Copy link
Member

Good catch Damien! Thanks and congrats on your first Symfony Docs contribution 🎉

@javiereguiluz javiereguiluz merged commit 9d989a5 into symfony:6.4 Jan 2, 2024
@MirakuSan
Copy link
Author

Thanks @javiereguiluz but this is not my first contribution 😄

@MirakuSan MirakuSan deleted the fix/typo-php-example-limiting-login-attempts branch January 2, 2024 09:33
@javiereguiluz
Copy link
Member

Sorry ... but GitHub displayed the "New contributor" label on your contribution 😐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants