Skip to content

Shortening code block for PHP #17178

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

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 8 additions & 24 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1396,14 +1396,10 @@ You must enable this using the ``login_throttling`` setting:
# by default, the feature allows 5 login attempts per minute
login_throttling: null

# configure the maximum login attempts (per minute)
# configure the maximum login attempts
login_throttling:
max_attempts: 3

# configure the maximum login attempts in a custom period of time
login_throttling:
max_attempts: 3
interval: '15 minutes'
max_attempts: 3 # per minute ...
# interval: '15 minutes' # ... or in a custom period

# use a custom rate limiter via its service ID
login_throttling:
Expand All @@ -1426,13 +1422,9 @@ You must enable this using the ``login_throttling`` setting:
<!-- ... -->

<firewall name="main">
<!-- by default, the feature allows 5 login attempts per minute -->
<login-throttling/>

<!-- configure the maximum login attempts (per minute) -->
<login-throttling max-attempts="3"/>

<!-- configure the maximum login attempts in a custom period of time -->
<!-- by default, the feature allows 5 login attempts per minute
max-attempts: (optional) You can configure the maximum attempts ...
interval: (optional) ... and the period of time. -->
<login-throttling max-attempts="3" interval="15 minutes"/>

<!-- use a custom rate limiter via its service ID -->
Expand All @@ -1452,17 +1444,9 @@ You must enable this using the ``login_throttling`` setting:
$mainFirewall = $security->firewall('main');

// by default, the feature allows 5 login attempts per minute
$mainFirewall->loginThrottling();

// configure the maximum login attempts (per minute)
$mainFirewall->loginThrottling()
->maxAttempts(3)
;

// configure the maximum login attempts in a custom period of time
$mainFirewall->loginThrottling()
->maxAttempts(3)
->interval('15 minutes')
// ->maxAttempts(3) // Optional: You can configure the maximum attempts ...
// ->interval('15 minutes') // ... and the period of time.
;
};

Expand Down