add ip to invalid token log
This commit is contained in:
@@ -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] + " for " + req.body.servername)
|
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user