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 @@ -63,7 +63,7 @@ final public function handle(GetResponseEvent $event)
6363 try {
6464 list ($ user , $ credentials ) = $ this ->getPreAuthenticatedData ($ request );
6565 } catch (BadCredentialsException $ exception ) {
66- $ this ->clearToken ();
66+ $ this ->clearToken ($ exception );
6767
6868 return ;
6969 }
@@ -91,21 +91,23 @@ final public function handle(GetResponseEvent $event)
9191 $ this ->dispatcher ->dispatch (SecurityEvents::INTERACTIVE_LOGIN , $ loginEvent );
9292 }
9393 } catch (AuthenticationException $ failed ) {
94- $ this ->clearToken ();
94+ $ this ->clearToken ($ failed );
9595 }
9696 }
9797
9898 /**
9999 * Clears a PreAuthenticatedToken for this provider (if present)
100+ *
101+ * @param AuthenticationException $exception
100102 */
101- protected function clearToken ()
103+ private function clearToken (AuthenticationException $ exception )
102104 {
103105 $ token = $ this ->securityContext ->getToken ();
104106 if ($ token instanceof PreAuthenticatedToken && $ this ->providerKey === $ token ->getProviderKey ()) {
105107 $ this ->securityContext ->setToken (null );
106108
107109 if (null !== $ this ->logger ) {
108- $ this ->logger ->info (sprintf ("Cleared security context due to exception: %s " , $ failed ->getMessage ()));
110+ $ this ->logger ->info (sprintf ("Cleared security context due to exception: %s " , $ exception ->getMessage ()));
109111 }
110112 }
111113 }
You can’t perform that action at this time.
0 commit comments