Remove logging succesful authentications - fills logs with useless lines

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2024-04-29 11:10:41 +01:00
parent d49a5ae034
commit afa4ad7915

View File

@ -21,21 +21,19 @@ module.exports = async function authCheck(
} else if (typeof id === "string") { } else if (typeof id === "string") {
const authCheck = (await isAuthed(id)) || false; const authCheck = (await isAuthed(id)) || false;
if (authCheck) { if (authCheck) {
// Authenticate
req.isAuthed = true; req.isAuthed = true;
logger.info("auth.middleware: Authentication Successful");
next(); next();
} else { } else {
req.isAuthed = false; req.isAuthed = false;
logger.info("auth.middleware: Authentication Failed"); logger.info("auth.middleware: Authentication Failed");
next(); next();
} }
// Handle cases where UUID passed as an array
} else if (Array.isArray(id)) { } else if (Array.isArray(id)) {
const authCheck = (await isAuthed(id[0])) || false; const authCheck = (await isAuthed(id[0])) || false;
if (authCheck) { if (authCheck) {
req.isAuthed = true; req.isAuthed = true;
logger.warn(
"auth.middleware: UUID Passed as Array - Authentication Successful"
);
next(); next();
} else { } else {
req.isAuthed = false; req.isAuthed = false;