authentication - Ajax request issue in sencha touch 2 -


i have problem sending ajax request authentification.. dont errors network in chrome says : method : , status : canceled , type : pending , no response request .. when click on file connection.js point in line :

             // start request!               xhr.send(requestoptions.data); 

& path name , method have color red

here code :

   ext.onready(function() {           ext.ajax.request({         url: 'https://api.mysite.com/api/oauth/',         method: 'get',         usedefaultxhrheader:false,         disablecaching: false,         timeout:120000,          params: {             client_id: 'xxxxxx',             client_secret: 'xxx',             format: 'json'         },         success: function(response) {              var resultat = ext.json.decode(response.responsetext);      //the response :           {"status":"ok","auth_token":"xxxxxxxxxxx"}             if (resultat.status === "ok") {                 if (!resultat.access_token === "") {                      access_token = resultat.access_token;                     me.sessiontoken = resultat.sessiontoken;                 }                 else                 {                     new ext.ajax.request({                         url: 'https://api.mysite.com/api/oauth/signin',                         method: 'post',                         params: {                             username: username,                             password: password,                             authtoken: resultat.access_token,                             format: 'json'                         },                         success: function(response) {                              var loginresponse = ext.json.decode(response.responsetext);                              if (loginresponse.success === "true") {                                 // server send token can used throughout app confirm user authenticated.                                 me.sessiontoken = loginresponse.sessiontoken;                                 me.signinsuccess();     //just simulating success.                             } else {                                 me.signinfailure(loginresponse.message);                             }                         },                         failure: function(response) {                             me.sessiontoken = null;                             me.signinfailure('login failed. please try again later.');                         }                      });                  }                 // server send token can used throughout app confirm user authenticated.               } else {                 //exception             }         }            ,            failure: function(response) {                  me.sessiontoken = null;                   ext.msg.alert('failed !!');    // shows me                  }          }); 


Comments