Commit 59c18d29 authored by Patricio Bruna's avatar Patricio Bruna

Fixed error on viewMailPath

parent 853709fa
......@@ -13934,7 +13934,7 @@ return /******/ (function(modules) { // webpackBootstrap
key: 'viewMailPath',
value: function viewMailPath(lifetime_seconds, callback) {
this.api.delegateAuth(this.id, lifetime_seconds, function (err, data) {
if (err) return callback(e);
if (err) return callback(err);
var token = data.authToken;
var path = '/service/preauth?authtoken=' + token + '&isredirect=1&adminPreAuth=1';
return callback(null, path);
......@@ -15003,6 +15003,7 @@ return /******/ (function(modules) { // webpackBootstrap
.send(JSON.stringify(requestPojo))
.end(function(err, data){
if (err) {
console.log(err);
var error_result = JSON.parse(data.text);
return callback(error_result.Body);
}
......@@ -43044,7 +43045,7 @@ return /******/ (function(modules) { // webpackBootstrap
module.exports = {
"name": "zimbra-admin-api-js",
"version": "0.1.3",
"version": "0.1.4",
"private": true,
"main": "lib/zimbra-admin-api.js",
"dependencies": {
This diff is collapsed.
{
"name": "zimbra-admin-api-js",
"version": "0.1.3",
"version": "0.1.4",
"private": true,
"main": "lib/zimbra-admin-api.js",
"dependencies": {
......
......@@ -15,7 +15,7 @@ export default class Account extends Zimbra {
viewMailPath(lifetime_seconds, callback) {
this.api.delegateAuth(this.id, lifetime_seconds, function(err, data){
if (err) return callback(e);
if (err) return callback(err);
const token = data.authToken;
const path = `/service/preauth?authtoken=${token}&isredirect=1&adminPreAuth=1`
return callback(null, path);
......
......@@ -745,4 +745,18 @@
});
});
describe('Timeout Error tests', function() {
this.timeout(5000);
it('should create and return an account', function(done){
let api = new ZimbraAdminApi(auth_data);
api.client.options.timeout = 100;
api.getAllAccounts(function(err, data){
console.log(err);
expect(err).to.exist;
done();
});
});
});
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment