From 5c1c336ff991d21296cd260d855c51db1861da44 Mon Sep 17 00:00:00 2001 From: Lars Vierbergen Date: Sun, 22 Oct 2017 20:16:18 +0200 Subject: [PATCH] Check if registration handler has failed before executing actions --- EventListener/RegistrationHandlerListener.php | 6 ++++++ 1 file changed, 6 insertions(+) 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); }