Skip to content

Commit 6f7abdd

Browse files
committed
Merge branch 'master' into dev
2 parents 45fcdac + 4e8d898 commit 6f7abdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/common/helper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,13 +957,15 @@ function getAuditM2Muser () {
957957
*/
958958
async function checkIsMemberOfProject (userId, projectId) {
959959
const m2mToken = await getM2MToken()
960+
localLogger.debug({ context: 'checkIsMemberOfProject', message: `m2mToken: ${m2mToken}` })
960961
const res = await request
961962
.get(`${config.TC_API}/projects/${projectId}`)
962963
.set('Authorization', `Bearer ${m2mToken}`)
963964
.set('Content-Type', 'application/json')
964965
.set('Accept', 'application/json')
966+
localLogger.debug({ context: 'checkIsMemberOfProject', message: `got project object ${projectId}: ${JSON.stringify(res.body)}` })
965967
const memberIdList = _.map(res.body.members, 'userId')
966-
localLogger.debug({ context: 'checkIsMemberOfProject', message: `the members of project ${projectId}: ${memberIdList}` })
968+
localLogger.debug({ context: 'checkIsMemberOfProject', message: `the members of project ${projectId}: ${JSON.stringify(memberIdList)}, authUserId: ${JSON.stringify(userId)}` })
967969
if (!memberIdList.includes(userId)) {
968970
throw new errors.UnauthorizedError(`userId: ${userId} the user is not a member of project ${projectId}`)
969971
}

0 commit comments

Comments
 (0)