req.connection.remoteAddress is deprecated

This commit is contained in:
Girish Ramakrishnan
2025-01-29 10:35:09 +01:00
parent b8c36b034b
commit 74f4849144
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ async function login(req, res, next) {
if ('type' in req.body && typeof req.body.type !== 'string') return next(new HttpError(400, 'type must be a string'));
const type = req.body.type || tokens.ID_WEBADMIN;
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || null;
const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || null;
const userAgent = req.headers['user-agent'] || '';
const tokenTypeError = tokens.validateTokenType(type);