Witam
Zrobiłem formularz logowania z pomocą dokumentacji symfony Dokumentacja, przerobiłem ten formularz pod ajax i mam problem, jak wpisuje dobre hasła to nie przekierowuje mnie dlatego że przez ajax nie wysyłam formularza, da się temu zaradzić?
.ajax({
method: 'POST',
url: urlPath,
dataType: 'JSON',
data: {
_username: usernameLogin,
_password: passwordLogin
},
success: function (json) {
console.log("Success: ");
console.log(json.errorLogin);
console.log(json.test);
},
complete: function () {
console.log('Ajax send!');
$('#errorResult').html('');
},
error: function (error) {
console.log(error);
}
});
return false;
$error = $authUtils->getLastAuthenticationError();
$json = array(
'errorLogin' => $error,
);
return new JsonResponse($json);