From 1e373c1986dbfa55cd1466044d3a06631e076586 Mon Sep 17 00:00:00 2001 From: clement callaert Date: Sat, 4 Nov 2023 20:21:05 +0100 Subject: [PATCH] mongodb --- middlewares/auth-middleware.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/middlewares/auth-middleware.js b/middlewares/auth-middleware.js index deda8e9..44a442b 100644 --- a/middlewares/auth-middleware.js +++ b/middlewares/auth-middleware.js @@ -6,9 +6,6 @@ async function auth (req, res, next) { const user = req.session.user; const isAuth = req.session.isAuthenticated; - if (!user || !isAuth) { - return next(); - } const userDoc = await db.getDb().collection('users').findOne({_id: user.id}) if (userDoc && userDoc.isAdmin) {