Commit 529e9460 authored by Jozef Vajdiar's avatar Jozef Vajdiar
Browse files

Update RegistrationController.php

parent 3658da48
......@@ -71,14 +71,14 @@ class RegistrationController extends AbstractController
if ($form->isSubmitted()) {
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$userCheck = $em->getRepository(Users::class)->findOneBy(['email'=>$user->getEmail()]);
if ($userCheck){
$this->addFlash('danger','Email is already registered!');
return new RedirectResponse($this->generateUrl('fos_user_registration_register'));
$event = new FormEvent($form, $request);
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_SUCCESS);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment