Bug 1045581 - [MobileID] The Mobile ID flow can't be completed with a manually inserted phone number. r=spenrose

This commit is contained in:
Fernando Jiménez 2014-09-03 16:21:41 +02:00
parent f85cc1ea84
commit 8c7cbd6354

View File

@ -35,7 +35,7 @@ this.MobileIdentityClient = function(aServerUrl) {
throw new Error(ERROR_INTERNAL_HTTP_NOT_ALLOWED);
}
this.hawk = new HawkClient(SERVER_URL);
this.hawk = new HawkClient(serverUrl);
this.hawk.observerPrefix = "MobileId:hawk";
};
@ -135,13 +135,17 @@ this.MobileIdentityClient.prototype = {
(response) => {
log.debug("MobileIdentityClient -> response.body " + response.body);
try {
let responseObj = JSON.parse(response.body);
let responseObj;
// We parse the response body unless we are handling a 204 response,
// which MUST NOT include a message body.
if (response.status != 204) {
responseObj = JSON.parse(response.body);
}
deferred.resolve(responseObj);
} catch (err) {
deferred.reject({error: err});
}
},
(error) => {
log.error("MobileIdentityClient -> Error ${}", error);
deferred.reject(SERVER_ERRNO_TO_ERROR[error.errno] || ERROR_UNKNOWN);