getUser()) { return $this->redirectToRoute('spa'); } return $this->render('security/login.html.twig', [ 'last_username' => $authenticationUtils->getLastUsername(), 'error' => $authenticationUtils->getLastAuthenticationError(), ]); } #[Route('/logout', name: 'app_logout')] public function logout(): never { throw new \LogicException('Handled by Symfony Security firewall.'); } #[Route('/register', name: 'app_register', methods: ['GET', 'POST'])] public function register(): Response { // Implemented in Story 1.3 return $this->render('security/register.html.twig'); } }