Skip to content

Commit ef629cf

Browse files
committed
impt bug fix to prevent flag leakage
1 parent 3237622 commit ef629cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

api/controllers/Challenges.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,13 @@ const submit = async (req, res, next) => {
353353
}
354354
}
355355
await collections.transactions.insertOne(insertDocument);
356-
transactionDocumentsUpdated.push(insertDocument) // mongoDB will add the _id field to insertDocument automatically
356+
transactionDocumentsUpdated.push({
357+
_id: insertDocument._id,
358+
username: res.locals.username,
359+
timestamp: Gtimestamp,
360+
points: calculatedPoints,
361+
lastChallengeID: latestSolveSubmissionID
362+
}) // mongoDB will add the _id field to insertDocument automatically
357363
}
358364
else await collections.transactions.insertOne(insertDocument);
359365

0 commit comments

Comments
 (0)