Skip to content

Commit ef5d7cc

Browse files
Gary PEGEOTGaryPEGEOT
authored andcommitted
Add wider check for existing access control rule
1 parent c6ab137 commit ef5d7cc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Security/SecurityConfigUpdater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function updateForAuthenticator(string $yamlSource, string $firewallName,
137137
$accessControlRules = $newData['security']['access_control'] ?? [];
138138

139139
foreach ($accessControlRules as $rule) {
140-
if ('^/login$' === $rule['path']) {
140+
if (0 === strpos($rule['path'], '^/login')) {
141141
$addAccessControlRule = false;
142142
break;
143143
}

tests/Security/yaml_fixtures/expected_authenticator/simple_security_with_access_control.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ security:
66
firewalls:
77
dev: ~
88
main:
9-
anonymous: true
9+
anonymous: lazy
1010
guard:
1111
authenticators:
1212
- App\Security\AppCustomAuthenticator
1313

14+
1415
# Easy way to control access for large sections of your site
1516
# Note: Only the *first* access control that matches will be used
1617
access_control:

tests/Security/yaml_fixtures/expected_authenticator/simple_security_with_added_access_control.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ security:
66
firewalls:
77
dev: ~
88
main:
9-
anonymous: true
9+
anonymous: lazy
1010
guard:
1111
authenticators:
1212
- App\Security\AppCustomAuthenticator

0 commit comments

Comments
 (0)