Skip to content

Commit 32ff824

Browse files
authored
Merge pull request #2365 from geoffrey-brier/disableable-authentication-listener
Disableable authentication listener
2 parents 0a0dcf1 + d6c4186 commit 32ff824

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

DependencyInjection/Configuration.php

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function getConfigTreeBuilder()
5050
->scalarNode('user_class')->isRequired()->cannotBeEmpty()->end()
5151
->scalarNode('firewall_name')->isRequired()->cannotBeEmpty()->end()
5252
->scalarNode('model_manager_name')->defaultNull()->end()
53+
->booleanNode('use_authentication_listener')->defaultTrue()->end()
5354
->booleanNode('use_listener')->defaultTrue()->end()
5455
->booleanNode('use_flash_notifications')->defaultTrue()->end()
5556
->booleanNode('use_username_form_type')->defaultTrue()->end()

DependencyInjection/FOSUserExtension.php

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public function load(array $configs, ContainerBuilder $container)
7171
$loader->load(sprintf('%s.xml', $basename));
7272
}
7373

74+
if ($config['use_authentication_listener']) {
75+
$container->removeDefinition('fos_user.listener.authentication');
76+
}
77+
7478
if ($config['use_flash_notifications']) {
7579
$loader->load('flash_notifications.xml');
7680
}

Resources/doc/configuration_reference.rst

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All available configuration options are listed below with their default values.
1111
user_class: ~ # Required
1212
use_listener: true
1313
use_flash_notifications: true
14+
use_authentication_listener: true
1415
use_username_form_type: true
1516
model_manager_name: null # change it to the name of your entity/document manager if you don't want to use the default one.
1617
from_email:

0 commit comments

Comments
 (0)