From 5a7c3d7fdbe1285f35ec28ff9c119e0ac10cc9bc Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 28 Nov 2021 15:50:10 -0500 Subject: [PATCH] changes to report --- src/api/comm.libraryofcode.org/routes/report.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/comm.libraryofcode.org/routes/report.ts b/src/api/comm.libraryofcode.org/routes/report.ts index 2b079e0..75da60f 100644 --- a/src/api/comm.libraryofcode.org/routes/report.ts +++ b/src/api/comm.libraryofcode.org/routes/report.ts @@ -217,7 +217,7 @@ export default class Report extends Route { const merchant = await this.server.client.db.Merchant.findOne({ key: req.headers.authorization }).lean().exec(); if (!merchant) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); - const report = await this.server.client.db.Score.findOne({ userID: req.body.userID }).lean().exec(); + const report = await this.server.client.db.Score.findOne({ userID: req.body.userID, 'pin.2': req.body.pin }).lean().exec(); if (!report) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); let totalScore: number;