From cf6264cc873301c5d8e021fa55268349c36e28c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Y=C3=BBki=20Vachot?= Date: Sun, 12 Dec 2021 01:49:58 +0100 Subject: [PATCH] Update: Auth refused is the role is not accepted --- app-backend/controllers/user.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app-backend/controllers/user.controller.js b/app-backend/controllers/user.controller.js index 50a00e1..fffbf09 100644 --- a/app-backend/controllers/user.controller.js +++ b/app-backend/controllers/user.controller.js @@ -15,7 +15,7 @@ exports.auth = (req, res) => { } else{ // Check User in the database User - .findOne({email: req.body.email, hashPass: req.body.hashPass, isActive: true}, {role: true, profileImageUrl: true}) + .findOne({email: req.body.email, hashPass: req.body.hashPass, isActive: true, "role.isAccepted": true}, {role: true, profileImageUrl: true}) .then(data => { if (data !== null){ User.findByIdAndUpdate(data._id.toString(), {lastConnexion: new Date()}, {useFindAndModify: false},