getUser()) { return $this->redirectToRoute('admin_pages'); } return $this->render('admin/login.html.twig', ['error' => $auth->getLastAuthenticationError(), 'username' => $auth->getLastUsername()]); } #[Route('/%kant.admin_path%/logout', name: 'admin_logout', methods: ['POST'])] public function logout(): never { throw new \LogicException('Handled by Symfony Security.'); } }