Selaa lähdekoodia

fixes a bug where RememberMeServices were not called consistently

Johannes M. Schmitt 14 vuotta sitten
vanhempi
commit
a367dfc3ec

+ 5 - 5
src/Symfony/Component/HttpKernel/Security/Firewall/AbstractAuthenticationListener.php

@@ -227,13 +227,13 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
         $this->eventDispatcher->notify(new Event($this, 'security.login_success', array('request' => $request, 'token' => $token)));
 
         if (null !== $this->successHandler) {
-            return $this->successHandler->onAuthenticationSuccess($request, $token);
+            $response = $this->successHandler->onAuthenticationSuccess($request, $token);
+        } else {
+            $response = new Response();
+            $path = $this->determineTargetUrl($request);
+            $response->setRedirect(0 !== strpos($path, 'http') ? $request->getUriForPath($path) : $path, 302);
         }
 
-        $response = new Response();
-        $path = $this->determineTargetUrl($request);
-        $response->setRedirect(0 !== strpos($path, 'http') ? $request->getUriForPath($path) : $path, 302);
-
         if (null !== $this->rememberMeServices) {
             $this->rememberMeServices->loginSuccess($request, $response, $token);
         }