login: function(email, password, callback) {
//alert(“In login function”);
$.ajax({
dataType: ‘json’,
contentType: ‘application/json; charset=utf-8’,
url: INSTANCE_URL + ‘/api/v2/user/session’,
data: JSON.stringify({
“email”: email,
“password”: password
}),
cache:false,
method:‘POST’,
success:function (response) {
callback(response);
},
error:function (response) {
callback(response);
return false;
}
});
},
On the api-docs feature the response properly loads the response.role and response.role_id properly but when I try to access the response.role and response.role_id in a seperate .js file both fields seem to be undefined.