render('security/login.html.twig', [ 'last_username' => $helper->getLastUsername(), 'error' => $helper->getLastAuthenticationError(), ]); } /** * This is the route the user can use to logout. * * But, this will never be executed. Symfony will intercept this first * and handle the logout automatically. See logout in config/packages/security.yaml * * @Route("/logout", name="security_logout") */ public function logout(): void { throw new \Exception('This should never be reached!'); } }