diff --git a/EventListener/RegistrationHandlerListener.php b/EventListener/RegistrationHandlerListener.php index f582755..80e1fb2 100644 --- a/EventListener/RegistrationHandlerListener.php +++ b/EventListener/RegistrationHandlerListener.php @@ -96,6 +96,8 @@ class RegistrationHandlerListener implements EventSubscriberInterface public function onHandleFormSetPasswordEnabled(RegistrationHandleEvent $event) { + if ($event->isFailed()) + return; $user = $event->getForm()->getData(); if (!$user) return; @@ -105,6 +107,8 @@ class RegistrationHandlerListener implements EventSubscriberInterface public function onHandleFormConnectExternal(RegistrationHandleEvent $event) { + if ($event->isFailed()) + return; $user = $event->getForm()->getData(); if (!$user) return; @@ -117,6 +121,8 @@ class RegistrationHandlerListener implements EventSubscriberInterface public function onHandleFormLogoutExternal(RegistrationHandleEvent $event) { + if ($event->isFailed()) + return; if ($this->getTemporaryUser()) $this->tokenStorage->setToken(null); }