Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
afa573fd
Commit
afa573fd
authored
May 19, 2016
by
Patricio Bruna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed error return when invalid login
parent
436dbd45
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
zimbra-admin-api.js
lib/zimbra-admin-api.js
+1
-1
zimbra-admin-api.js.map
lib/zimbra-admin-api.js.map
+1
-1
index.js
src/index.js
+1
-1
test.js
test/js/spec/test.js
+14
-0
No files found.
lib/zimbra-admin-api.js
View file @
afa573fd
...
@@ -175,7 +175,7 @@ return /******/ (function(modules) { // webpackBootstrap
...
@@ -175,7 +175,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.client.auth(auth_object, function (err, response) {
this.client.auth(auth_object, function (err, response) {
that.secret = null;
that.secret = null;
that.password = null;
that.password = null;
if (err) return
(callback || that.handleError)(err
);
if (err) return
callback(that.handleError(err)
);
return (callback || that.handleResponse)(null, response);
return (callback || that.handleResponse)(null, response);
});
});
}
}
lib/zimbra-admin-api.js.map
View file @
afa573fd
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/index.js
View file @
afa573fd
...
@@ -82,7 +82,7 @@ export default class ZimbraAdminApi {
...
@@ -82,7 +82,7 @@ export default class ZimbraAdminApi {
this
.
client
.
auth
(
auth_object
,
function
(
err
,
response
){
this
.
client
.
auth
(
auth_object
,
function
(
err
,
response
){
that
.
secret
=
null
;
that
.
secret
=
null
;
that
.
password
=
null
;
that
.
password
=
null
;
if
(
err
)
return
(
callback
||
that
.
handleError
)(
err
);
if
(
err
)
return
callback
(
that
.
handleError
(
err
)
);
return
(
callback
||
that
.
handleResponse
)(
null
,
response
);
return
(
callback
||
that
.
handleResponse
)(
null
,
response
);
});
});
}
}
...
...
test/js/spec/test.js
View file @
afa573fd
...
@@ -110,6 +110,20 @@
...
@@ -110,6 +110,20 @@
api
.
login
(
callback
);
api
.
login
(
callback
);
});
});
it
(
'should return Error with wrong Login'
,
function
(
done
){
let
auth_obj
=
{
'url'
:
'http://zimbra.zboxapp.dev:8000/service/admin/soap'
,
'user'
:
'admin@zboxapp.dev'
,
'password'
:
'12345678910'
}
let
api
=
new
ZimbraAdminApi
(
auth_obj
);
api
.
login
(
function
(
err
,
data
){
expect
(
err
.
extra
.
code
).
to
.
be
.
equal
(
"account.AUTH_FAILED"
);
expect
(
err
.
extra
.
reason
).
to
.
match
(
/authentication failed/
);
done
();
});
});
it
(
'should return directorySearch with total info'
,
function
(
done
){
it
(
'should return directorySearch with total info'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
let
api
=
new
ZimbraAdminApi
(
auth_data
);
let
query_object
=
{
limit
:
10
,
domain
:
'customer.dev'
,
types
:
"accounts"
};
let
query_object
=
{
limit
:
10
,
domain
:
'customer.dev'
,
types
:
"accounts"
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment