File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/Symfony/Component/Security/Http/Firewall Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -76,13 +76,15 @@ public function handle(GetResponseEvent $event)
76
76
}
77
77
78
78
try {
79
- $ this ->securityContext ->setToken (null );
80
79
$ token = $ this ->simpleAuthenticator ->createToken ($ request , $ this ->providerKey );
81
80
82
- if ( $ token instanceof TokenInterface) {
83
- $ token = $ this -> authenticationManager -> authenticate ( $ token );
84
- $ this -> securityContext -> setToken ( $ token ) ;
81
+ // allow null to be returned to skip authentication
82
+ if ( null === $ token ) {
83
+ return ;
85
84
}
85
+
86
+ $ token = $ this ->authenticationManager ->authenticate ($ token );
87
+ $ this ->securityContext ->setToken ($ token );
86
88
} catch (AuthenticationException $ e ) {
87
89
$ this ->securityContext ->setToken (null );
88
90
You can’t perform that action at this time.
0 commit comments