getLastAuthenticationError(); if ($error) { $this->addFlash('danger', $error->getMessage()); }else{ $this->addFlash('success', "User loged in."); } $this->addFlash('info', $authenticationUtils->getLastUsername()); return $this->render("user/login.html.twig",[ 'last_username'=>$authenticationUtils->getLastUsername(), ]); } }