Skip to content

Commit

Permalink
afegir admin tocken al middleware per checkPerson
Browse files Browse the repository at this point in the history
  • Loading branch information
Indigestion1 committed Apr 30, 2024
1 parent fd200a7 commit 141b2f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion back_api/routes/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit 141b2f6

Please sign in to comment.