Merge pull request #34 from Legonzaur/main

add logging
This commit is contained in:
Legonzaur
2023-05-02 13:59:10 +02:00
committed by GitHub
+3 -1
View File
@@ -23,7 +23,9 @@ router.post(
} }
const query = await CheckServerToken(req.headers.authorization.split(' ')[1]) const query = await CheckServerToken(req.headers.authorization.split(' ')[1])
if (!query || !query.id) { if (!query || !query.id) {
console.error("incorrect token : " + req.headers.authorization.split(' ')[1]) console.error("incorrect token : " + req.headers.authorization.split(' ')[1] + " for " + req.body.servername + " with IP " + (req.headers['x-forwarded-for']?.toString() ||
req.socket.remoteAddress?.toString() ||
''))
return res.sendStatus(403) return res.sendStatus(403)
} }
next() next()