mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-14 08:49:51 -05:00
Use ip instead of remoteAddress for logging
This commit is contained in:
parent
e4684384ea
commit
f1437f16a9
@ -36,7 +36,7 @@ const validateInvite = wrap(async (req, res, next) => {
|
|||||||
|
|
||||||
if (!invite) {
|
if (!invite) {
|
||||||
// Log failure
|
// Log failure
|
||||||
await fs.appendFile('auth.log', `${new Date().toISOString()} register ${req.connection.remoteAddress}\n`);
|
await fs.appendFile('auth.log', `${new Date().toISOString()} register ${req.ip}\n`);
|
||||||
return res.status(422).json({message: 'Invalid invite code.'});
|
return res.status(422).json({message: 'Invalid invite code.'});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ router.post('/login', bodyVerifier(loginProps), canonicalizeRequest, wrap(async
|
|||||||
const user = await authenticate(req, res, next);
|
const user = await authenticate(req, res, next);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
// Log failure
|
// Log failure
|
||||||
await fs.appendFile('auth.log', `${new Date().toISOString()} login ${req.connection.remoteAddress}\n`);
|
await fs.appendFile('auth.log', `${new Date().toISOString()} login ${req.ip}\n`);
|
||||||
return res.status(401).json({'message': 'Unauthorized.'});
|
return res.status(401).json({'message': 'Unauthorized.'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ const checkKey = async (req, scope, status) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Log failure
|
// Log failure
|
||||||
await fs.appendFile('auth.log', `${new Date().toISOString()} key ${req.connection.remoteAddress}\n`);
|
await fs.appendFile('auth.log', `${new Date().toISOString()} key ${req.ip}\n`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user