diff --git a/src/api/loc.sh/routes/internal.ts b/src/api/loc.sh/routes/internal.ts index 00d3294..0a06342 100644 --- a/src/api/loc.sh/routes/internal.ts +++ b/src/api/loc.sh/routes/internal.ts @@ -202,7 +202,7 @@ export default class Internal extends Route { this.router.get('/id', async (req, res) => { try { - if (req.query?.auth.toString() !== this.server.client.config.internalKey) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); + if (req.query?.auth?.toString() !== this.server.client.config.internalKey) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); if (!req.query.pin) return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR }); const args = req.query.pin.toString(); const user = await this.server.client.db.Score.findOne({ pin: [Number(args.split('-')[0]), Number(args.split('-')[1]), Number(args.split('-')[2])] }).lean().exec(); @@ -215,7 +215,7 @@ export default class Internal extends Route { this.router.get('/pin', async (req, res) => { try { - if (req.query?.auth.toString() !== this.server.client.config.internalKey) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); + if (req.query?.auth?.toString() !== this.server.client.config.internalKey) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); if (!req.query.id) return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR }); const report = await this.server.client.db.Score.findOne({ userID: req.query.id.toString() });