Skip to content

Commit 6be2f1a

Browse files
authored
fix(organization-members): mfa flag (#621)
1 parent 8f5c160 commit 6be2f1a

File tree

3 files changed

+46
-37
lines changed

3 files changed

+46
-37
lines changed

pnpm-lock.yaml

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions/organization/members/get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const redisKey = require('../../../utils/key');
44
const getUserId = require('../../../utils/userData/get-user-id');
55
const { getMemberData } = require('../../../utils/organization/get-organization-members');
66
const { checkOrganizationExists } = require('../../../utils/organization');
7-
const isMFAEnabled = require('../../../utils/mfa');
7+
const { isMFAEnabled } = require('../../../utils/mfa');
88
const {
99
ORGANIZATIONS_MEMBERS,
1010
USERS_METADATA,
@@ -37,7 +37,7 @@ async function getMember({ params }) {
3737

3838
const userDataCalls = [getMemberData.call(this, memberKey)];
3939
if (showMfa) {
40-
userDataCalls.push(isMFAEnabled(userId));
40+
userDataCalls.push(isMFAEnabled.call(this, userId));
4141
}
4242

4343
const [member, mfaEnabled] = await Promise.all(userDataCalls);

test/suites/actions/organization/members/get.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ const { createOrganization, createMembers } = require('../../../../helpers/organ
66
describe('#get organization member', function registerSuite() {
77
this.timeout(50000);
88

9-
beforeEach(startService);
9+
beforeEach(async function () {
10+
await startService.call(this, {
11+
organizations: {
12+
audience: 'organizations',
13+
showMfa: true,
14+
},
15+
});
16+
});
1017
beforeEach(function pretest() { return createMembers.call(this); });
1118
beforeEach(function pretest() { return createOrganization.call(this); });
1219
afterEach(clearRedis);
@@ -30,6 +37,8 @@ describe('#get organization member', function registerSuite() {
3037
.then((response) => {
3138
assert(response.data.hasOwnProperty('id'));
3239
assert(response.data.hasOwnProperty('type'));
40+
assert(response.data.hasOwnProperty('attributes'));
41+
assert(response.data.attributes.hasOwnProperty('mfaEnabled'));
3342
assert.deepEqual(response.data.attributes.username, opts.username);
3443
});
3544
});

0 commit comments

Comments
 (0)