1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-12-11 14:02:19 -05:00

Add newline to auth logging

This commit is contained in:
Jack Foltz 2018-12-26 19:15:29 -05:00
parent 95d39e07b9
commit e4684384ea
Signed by: foltik
GPG Key ID: D1F0331758D1F29A
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ const validateInvite = wrap(async (req, res, next) => {
if (!invite) {
// Log failure
await fs.appendFile('auth.log', `${new Date().toISOString()} register ${req.connection.remoteAddress}`);
await fs.appendFile('auth.log', `${new Date().toISOString()} register ${req.connection.remoteAddress}\n`);
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);
if (!user) {
// Log failure
await fs.appendFile('auth.log', `${new Date().toISOString()} login ${req.connection.remoteAddress}`);
await fs.appendFile('auth.log', `${new Date().toISOString()} login ${req.connection.remoteAddress}\n`);
return res.status(401).json({'message': 'Unauthorized.'});
}

View File

@ -33,7 +33,7 @@ const checkKey = async (req, scope, status) => {
}
} else {
// Log failure
await fs.appendFile('auth.log', `${new Date().toISOString()} key ${req.connection.remoteAddress}`);
await fs.appendFile('auth.log', `${new Date().toISOString()} key ${req.connection.remoteAddress}\n`);
}
}
};