diff --git a/src/middlewares/auth.middlewares.ts b/src/middlewares/auth.middlewares.ts index 3eea2eb..150eeca 100644 --- a/src/middlewares/auth.middlewares.ts +++ b/src/middlewares/auth.middlewares.ts @@ -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;