diff --git a/app/controllers/auth.controller.js b/app/controllers/auth.controller.js index cbeaafa..a9afb02 100644 --- a/app/controllers/auth.controller.js +++ b/app/controllers/auth.controller.js @@ -32,9 +32,9 @@ exports.login = async (req, res) => { const { email, password } = req.body; userRole = 'EstablishmentUser' - userData = await EstablishmentUser.findOne({ where: { email } }); + userData = await EstablishmentUser.findOne({ where: { email, is_active : { [Op.or]: [true, 1] } } }); if (!userData) { - userData = await User.findOne({ where: { email } }); + userData = await User.findOne({ where: { email, is_active : { [Op.or]: [true, 1] } } }); userRole = 'Admin' if (!userData) res.status(404).send({'status':"failed",'message':"User not found",'data': ""}); }