req.connection.remoteAddress is deprecated
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user