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
1 changed files with 2 additions and 4 deletions

View File

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