| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | #[Route('/email/verify', name: 'verify_email')] |
||
| 25 | public function verifyUserEmail(Request $request, TranslatorInterface $translator): Response |
||
| 26 | { |
||
| 27 | $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); |
||
| 28 | |||
| 29 | // validate email confirmation link, sets User::isVerified=true and persists |
||
| 30 | try { |
||
| 31 | $this->emailVerifier->handleEmailConfirmation($request, $this->getUser()); |
||
| 32 | } catch (VerifyEmailExceptionInterface $exception) { |
||
| 33 | $this->addFlash('danger', $translator->trans($exception->getReason(), [], 'VerifyEmailBundle')); |
||
| 34 | |||
| 35 | return $this->redirectToRoute('user_property'); |
||
| 36 | } |
||
| 37 | |||
| 38 | $this->addFlash('success', 'message.email_verified'); |
||
| 39 | |||
| 40 | return $this->redirectToRoute('user_property'); |
||
| 41 | } |
||
| 43 |