Check if registration handler has failed before executing actions

master
Lars Vierbergen 7 years ago
parent 088e997203
commit 5c1c336ff9
  1. 6
      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);
}