Skip to content

Commit ccac120

Browse files
Fix issue with M2M tokens on getChallenge
1 parent 6142478 commit ccac120

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/ChallengeService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,10 @@ async function getChallenge (currentUser, id) {
500500
// delete challenge.typeId
501501

502502
// Remove privateDescription for unregistered users
503-
if (currentUser) {
503+
if (currentUser && !currentUser.isMachine) {
504504
const ids = await helper.listChallengesByMember(currentUser.userId)
505505
if (!_.includes(ids, challenge.id)) {
506+
_.unset(challenge, 'privateDescription')
506507
}
507508
} else {
508509
_.unset(challenge, 'privateDescription')

0 commit comments

Comments
 (0)