From 3a8b1c88c06fb156e48378771be6f459ed94ab38 Mon Sep 17 00:00:00 2001
From: tracer <tracer@24unix.net>
Date: Wed, 9 Jun 2021 19:15:07 +0200
Subject: [PATCH] before change of user class

---
 src/Controller/RegistrationController.php | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php
index a45f0c6..12d6695 100644
--- a/src/Controller/RegistrationController.php
+++ b/src/Controller/RegistrationController.php
@@ -15,6 +15,10 @@ use Symfony\Component\Routing\Annotation\Route;
 use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
 use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
 
+/**
+ * Class RegistrationController
+ * @package App\Controller
+ */
 class RegistrationController extends AbstractController
 {
     private $emailVerifier;
@@ -67,14 +71,14 @@ class RegistrationController extends AbstractController
     {
         $id = $request->get('id');
 
-        if (null === $id) {
-            return $this->redirectToRoute('app_register');
+        if ($id === null) {
+            return $this->redirectToRoute('app_login');
         }
 
         $user = $userRepository->find($id);
 
-        if (null === $user) {
-            return $this->redirectToRoute('app_register');
+        if ($user === null) {
+            return $this->redirectToRoute('app_login');
         }
 
         // validate email confirmation link, sets User::isVerified=true and persists
@@ -83,12 +87,12 @@ class RegistrationController extends AbstractController
         } catch (VerifyEmailExceptionInterface $exception) {
             $this->addFlash('verify_email_error', $exception->getReason());
 
-            return $this->redirectToRoute('app_register');
+            return $this->redirectToRoute('app_login');
         }
 
         // @TODO Change the redirect on success and handle or remove the flash message in your templates
         $this->addFlash('success', 'Your email address has been verified.');
 
-        return $this->redirectToRoute('app_register');
+        return $this->redirectToRoute('blogs');
     }
 }