is_active checking in user login
This commit is contained in:
parent
25576a2627
commit
fbda6dfd8b
@ -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': ""});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user