Skip to content

Commit

Permalink
Merge pull request #254 from auth0/group-memnbers-fix
Browse files Browse the repository at this point in the history
ESD-367: Group Members fix
  • Loading branch information
zxan1285 authored May 22, 2019
2 parents 29b40ad + 07e1302 commit 4026c5d
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.6.5] - 2019-05-22

- Group Members page will display "broken" members and allow to remove them.

## [2.6.4] - 2019-04-19

- `PUBLIC_WT_URL` generation fixed for specific clusters
Expand Down
2 changes: 1 addition & 1 deletion build/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth0-authz-extension",
"version": "2.6.4",
"version": "2.6.5",
"description": "Auth0 Authorization Extension",
"engines": {
"node": ">=6.10"
Expand Down
2 changes: 1 addition & 1 deletion server/api/users/routes/get_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = (server) => ({
query: {
q: Joi.string().max(1000).allow('').default(''),
field: Joi.string().max(1000).allow('').default(''),
per_page: Joi.number().integer().min(1).max(200).default(100), // eslint-disable-line newline-per-chained-call
per_page: Joi.number().integer().min(1).max(100).default(100), // eslint-disable-line newline-per-chained-call
page: Joi.number().integer().min(0).default(0)
}
},
Expand Down
23 changes: 10 additions & 13 deletions server/lib/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ export function getUsersById(client, ids, page, limit) {
cb();
})
.catch((err) => {
if (err && err.statusCode === 404) {
users.push({
user_id: userId,
name: '<User Not Found>',
email: userId,
identities: [
{ connection: 'N/A' }
]
});
return cb();
}

return cb(err);
const errDescription = err && (err.name || err.statusCode);
users.push({
user_id: userId,
name: `<Error: ${errDescription}>`,
email: userId,
identities: [
{ connection: 'N/A' }
]
});
return cb();
});
}, (err) => {
if (err) {
Expand Down
13 changes: 8 additions & 5 deletions tests/unit/server/groups-members-route.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ describe('groups-members-route', () => {
_id: guid,
name: groupName,
description: 'description',
members: [uid]
members: [ uid, 'undefined' ]
};
const parentGroup = {
_id: pgid,
name: groupName,
description: 'description',
members: [uid],
nested: [ngid]
members: [ uid ],
nested: [ ngid ]
};
const nestedGroup = {
_id: ngid,
name: groupName,
description: 'description',
members: [nuid],
members: [ nuid ]
};

before((done) => {
Expand Down Expand Up @@ -81,7 +81,10 @@ describe('groups-members-route', () => {
server.inject(options, (response) => {
expect(response.statusCode).to.be.equal(200);
expect(response.result.users).to.be.a('array');
expect(response.result.total).to.be.equal(1);
expect(response.result.users[0].user_id).to.be.equal(uid);
expect(response.result.users[1].user_id).to.be.equal('undefined');
expect(response.result.users[1].name).to.be.equal('<Error: APIError>');
expect(response.result.total).to.be.equal(2);
cb();
});
});
Expand Down
2 changes: 1 addition & 1 deletion webtask.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Auth0 Authorization",
"name": "auth0-authz",
"version": "2.6.4",
"version": "2.6.5",
"preVersion": "2.5.2",
"author": "auth0",
"description": "This extension gives Auth0 customers the possibility to manage group memberships for their users.",
Expand Down

0 comments on commit 4026c5d

Please sign in to comment.