Remove logging succesful authentications - fills logs with useless lines
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
d49a5ae034
commit
afa4ad7915
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user