File tree 1 file changed +3
-7
lines changed
src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -27,29 +27,25 @@ class RegisterCsrfFeaturesPass implements CompilerPassInterface
27
27
{
28
28
public function process (ContainerBuilder $ container )
29
29
{
30
- if (!$ container ->has ('security.csrf.token_storage ' )) {
31
- return ;
32
- }
33
-
34
30
$ this ->registerCsrfProtectionListener ($ container );
35
31
$ this ->registerLogoutHandler ($ container );
36
32
}
37
33
38
34
private function registerCsrfProtectionListener (ContainerBuilder $ container )
39
35
{
40
- if (!$ container ->has ('security.authenticator.manager ' )) {
36
+ if (!$ container ->has ('security.authenticator.manager ' ) || ! $ container -> has ( ' security.csrf.token_manager ' ) ) {
41
37
return ;
42
38
}
43
39
44
40
$ container ->register ('security.listener.csrf_protection ' , CsrfProtectionListener::class)
45
- ->addArgument (new Reference ('security.csrf.token_storage ' ))
41
+ ->addArgument (new Reference ('security.csrf.token_manager ' ))
46
42
->addTag ('kernel.event_subscriber ' )
47
43
->setPublic (false );
48
44
}
49
45
50
46
protected function registerLogoutHandler (ContainerBuilder $ container )
51
47
{
52
- if (!$ container ->has ('security.logout_listener ' )) {
48
+ if (!$ container ->has ('security.logout_listener ' ) || ! $ container -> has ( ' security.csrf.token_storage ' ) ) {
53
49
return ;
54
50
}
55
51
You can’t perform that action at this time.
0 commit comments