This commit is contained in:
2025-03-31 00:22:21 +03:00
commit 38f2a05107
146 changed files with 66771 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
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();