I'm creating an application with phonegap on windows phone 7, that need an authentification on a server. When we log with the correct username and password, we got a 200 status. And everything works. But if we make a mistake on the login or the password, the server send us back a 401 error. This freeze my application. I need to kill it and restart it. So not very practice.
I check the response with fiddler on my computer and the phone receive the 401 error, and I manage this error on my code. this works on my other platform (android and ios).
So I would like to know how I can manage this error. Maybe I can change a cs file on the windows phone project to handle this error.
any help is welcome
Here is the code
$.support.cors = true;
$.ajax({
type: "POST",
dataType: "HTTP/1.1",
url: 'https://xxx.xxx-xxx.com/issue/wrap',
data: data,
cache: 'false',
async: false,
error: function (data) {
console.log(data);
console.log("error");
//navigator.notification.alert(data);
},
complete: saveToken
});
thanks