Okay the error seems to be coming from my javascript. If i login using http://localhost:8000/login it works fine.
But i have a login dropdown box on the nav menu which is controlled by jquery in my site.js file
$('#login-nav').submit(function() {
var email = $("#email").val();
var password = $("#password").val();
var formData = {
email : email,
password : password,
_token : $('input[name=_token]').val()
}
var notify = $.notify('<strong>Submitting </strong>login please wait ...', {
type: 'success',
allow_dismiss: false,
showProgressbar: true
})
if (email == "" && password == "") {
setTimeout(function() {
notify.update('message', '<strong>No</strong> e-mail address and password was entered upon login.');
notify.update('type', 'danger');
notify.update('progress', 100);
}, 1000);
$("#email").addClass("has-error");
$("#password").addClass("has-error");
setTimeout(function() {
$.notify({ // options
icon: 'fa fa-danger',
message: "Please enter an e-mail address and password to login!"
},{ // settings
type: 'danger',
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
}
});
}, 2000);
return false;
}
else if (password == "") {
setTimeout(function() {
notify.update('message', '<strong>No</strong> password was entered upon login.');
notify.update('type', 'danger');
notify.update('progress', 100);
}, 1000);
$("#password").addClass("has-error");
setTimeout(function() {
$.notify({ // options
icon: 'fa fa-danger',
message: "Please enter a password to login!"
},{ // settings
type: 'danger',
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
}
});
}, 2000);
return false;
}
else if (email == "") {
setTimeout(function() {
notify.update('message', '<strong>No</strong> e-mail address was entered upon login.');
notify.update('type', 'danger');
notify.update('progress', 100);
}, 1000);
$("#email").addClass("has-error");
setTimeout(function() {
$.notify({ // options
icon: 'fa fa-danger',
message: "Please enter an e-mail address!"
},{ // settings
type: 'danger',
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
}
});
}, 2000);
return false;
}
setTimeout(function() {
notify.update('message', '<strong>Checking</strong> if you have submitted an e-maill address and password.');
}, 2000);
setTimeout(function() {
notify.update('message', '<strong>Succesfully</strong> submitting e-mail address and password for logging in.');
}, 3000);
setTimeout(function() {
notify.update('message', '<strong>Attempting</strong> to login!');
notify.update('progress', 100);
}, 4000);
setTimeout(function () {
$.ajax({
type : "POST",
url : '/login',
data : formData,
cache : false,
success : function() {
location.reload();
},
error : function() {
alert("Fail");
}
});
}, 4000);
return false;
});
it seems to be when i have auth.login listener it is causing problems with my ajax login??? any reason why??