From e4684384eadfec3a7b12aeede4d8783b956a6d33 Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Wed, 26 Dec 2018 19:15:29 -0500 Subject: [PATCH] Add newline to auth logging --- app/routes/api/auth.js | 4 ++-- app/util/auth.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/routes/api/auth.js b/app/routes/api/auth.js index 38f8308..1fda18d 100644 --- a/app/routes/api/auth.js +++ b/app/routes/api/auth.js @@ -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.'}); } diff --git a/app/util/auth.js b/app/util/auth.js index 40d1dd4..0f278b4 100644 --- a/app/util/auth.js +++ b/app/util/auth.js @@ -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`); } } };