getLastAuthenticationError(); // last username entered by the user $lastUsername = $authenticationUtils->getLastUsername(); return $this->render('security/login.html.twig', array_merge( $this->getControllerVariables(), [ 'login_title' => $this->trans("login.title",domain:"security"), 'login_button' => $this->trans("login.button",domain:"security"), 'login_username' => $this->trans("login.username",domain:"security"), 'login_password' => $this->trans("login.password",domain:"security"), 'login_remember_me' => $this->trans("login.remember_me",domain:"security"), 'login_forgotten_password' => $this->trans("login.forgotten_password",domain:"security"), 'last_username' => $lastUsername, 'error' => $error, ])); } #[Route('/logout',name:'app_logout')] public function logout(Security $security): Response { if ($this->getUser()) { $response = $security->logout(false); } else { $response = $this->redirect("Login"); } return $response; } }