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'); } }