src/Lms/UserInterface/WebApp/FrontController/AppController.php line 47

Open in your IDE?
  1. <?php
  2. namespace CodersLab\Lms\UserInterface\WebApp\FrontController;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Cookie;
  5. use Symfony\Component\HttpFoundation\RedirectResponse;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. final class AppController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/404", name="not_found")
  13.      */
  14.     public function render404(): Response
  15.     {
  16.         throw new NotFoundHttpException('Page not found');
  17.     }
  18.     /**
  19.      * @Route("/byebye", name="app_logout", methods={"GET"})
  20.      */
  21.     public function logoutAction(): Response
  22.     {
  23.         $url $this->generateUrl('fos_user_security_logout');
  24.         $redirect = new RedirectResponse($url);
  25.         $redirect->headers->setCookie(new Cookie('jwt'));
  26.         return $redirect;
  27.     }
  28.     /**
  29.      * @Route("/resetting/done", name="fos_user_profile_show", methods={"GET"})
  30.      */
  31.     public function resetDone(): Response
  32.     {
  33.         $url $this->generateUrl('front_homepage', ['reactRouting' => '']);
  34.         return new RedirectResponse($url);
  35.     }
  36.     /**
  37.      * @Route("/{reactRouting}", name="front_homepage", requirements={"reactRouting"=".*"})
  38.      */
  39.     public function renderFront(): Response
  40.     {
  41.         return $this->render('react_app.html.twig');
  42.     }
  43. }