/**
* @param AuthenticationUtils $authenticationUtils
* @Route("/login", name="app_login")
* @return Response
*/
public function login(AuthenticationUtils $authenticationUtils): Response
{
//Хотел бы убрать эту часть
if($user = $this->getUser()) {
return $this->redirectToRoute('dashboard');
}
return $this->render('security/login.html.twig', ['last_username' => $authenticationUtils->getLastUsername(), 'error' => $authenticationUtils->getLastAuthenticationError()]);
}