My First Image is my network -> headers
My Second Image is my console
The situation is trying to log-in with incorrect credentials about 15-20 times
What I want to achieve is be able to determine In my client which is AngularJS if I have a response status of 429.. I did a:
console.log(response)
on the second image but I can not determine on my client side if I received a 429 status request
function(response){
var res_data = (response.data && response.data.data) ? response.data.data : null;
var res_status = response.status;
FlashService.Error(response[keys.issue_fields], true);
console.log(response);
console.log("----");
if (res_status == 513 && res_data && res_data[keys.issue_fields][0] == keys.email) {
vm.error = "Your email is not recognized. Please try again.";
} else if (res_status == 513 && res_data && res_data[keys.issue_fields][0] == keys.password){
vm.error = "Your email and password combination was incorrect. Please try again.";
} else if (res_status == 513 && res_data && res_data[keys.issue_fields][0] == keys.suspension){
vm.error = "Your account is inactive.";
}else if (res_status == -1) {
vm.error = "Error connecting to server.";
}else if(res_status == 429){
vm.error = "You have attempted a numerous login failed attempt.. Please try again later.";
}else {
vm.error = "Your email and password combination was incorrect. Please try again.";
}
vm.dataLoading = false;
}
PS
The code should work fine, it's just I cant get the response code at all