diff --git a/back_api/routes/middleware.js b/back_api/routes/middleware.js index 658c248..a157c9e 100644 --- a/back_api/routes/middleware.js +++ b/back_api/routes/middleware.js @@ -65,7 +65,10 @@ async function checkPerson(req, res, next) { const clientRef = db.collection('clients').doc(decryptedUid); const clientDoc = await clientRef.get(); - if (!userDoc.exists && !clientDoc.exists) { + const adminReg = db.collection('administradors').doc(decryptedUid); + const adminDoc = await clientRef.get(); + + if (!userDoc.exists && !clientDoc.exists && !adminDoc.exists) { return res.status(404).send('Usuario o cliente que envió la solicitud no encontrado'); }