fixes to auth

merge-requests/4/head
Matthew 2020-09-13 20:56:37 -04:00
parent d37ef9ae2a
commit 082876e377
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ export default class Webhook extends Route {
this.router.get('/score', async (req, res) => { this.router.get('/score', async (req, res) => {
try { try {
if (req.query?.authorization !== this.server.security.keys.iv.toString('hex')) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); if (req.query?.authorization !== this.server.security.keys.internal.toString('hex')) 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 }); if (!req.query?.id) return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR });
const account = await this.server.client.db.Account.findOne({ userID: req.query.id.toString() }).lean().exec(); const account = await this.server.client.db.Account.findOne({ userID: req.query.id.toString() }).lean().exec();