const AuthService = require('../services/auth.service'); class AuthController { async login(req, res) { if (req.sheepId && req.sheepRole) { const result = await AuthService.findUserByID(req.sheepId, req.sheepRole); if (result) { return res.status(200).send(result); } else { return res.status(404).send({ message: 'Sheep not found.' }); } } else { return res .status(403) .send({ message: 'The sheep does not have enough rights.' }); } } } module.exports = new AuthController();