yes I was
This commit is contained in:
@@ -39,12 +39,14 @@ checkDuplicateUsernameOrEmail = (req, res, next) => {
|
|||||||
|
|
||||||
checkRolesExisted = (req, res, next) => {
|
checkRolesExisted = (req, res, next) => {
|
||||||
if (req.body.roles) {
|
if (req.body.roles) {
|
||||||
|
for (let i = 0; i < req.body.roles.length; i++) {
|
||||||
if (!ROLES.includes(req.body.roles[i])) {
|
if (!ROLES.includes(req.body.roles[i])) {
|
||||||
res.status(400).send({
|
res.status(400).send({
|
||||||
message: `oof! ce role ${req.body.roles[i]} n'existe pas`
|
message: `oof! ce role ${req.body.roles[i]} n'existe pas`
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
@@ -75,14 +77,12 @@ validateEmail = async (req, res, next) => {
|
|||||||
|
|
||||||
checkPassLimit = (req, res, next) => {
|
checkPassLimit = (req, res, next) => {
|
||||||
if (req.body.password) {
|
if (req.body.password) {
|
||||||
for (let i = 0; i < req.body.password.length; i++) {
|
|
||||||
if (req.body.password.length <= 8) {
|
if (req.body.password.length <= 8) {
|
||||||
res.status(400).send({
|
res.status(400).send({
|
||||||
message: "oof! ce password ne respecte pas les limitations en cours."
|
message: "oof! ce password ne respecte pas les limitations en cours."
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user