Make sure min password length is not null
This commit is contained in:
parent
ece68990f8
commit
41f14b3ad8
@ -225,11 +225,12 @@ router.post(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (body.password) {
|
if (body.password) {
|
||||||
if(body.password.length < register.password.minLength){
|
const min = register.password.minLength ? register.password.minLength : 8;
|
||||||
|
if(body.password.length < min){
|
||||||
throw FieldErrors({
|
throw FieldErrors({
|
||||||
password: {
|
password: {
|
||||||
code: "PASSWORD_REQUIREMENTS_MIN_LENGTH",
|
code: "PASSWORD_REQUIREMENTS_MIN_LENGTH",
|
||||||
message: req.t("auth:register.PASSWORD_REQUIREMENTS_MIN_LENGTH", { min: register.password.minLength })
|
message: req.t("auth:register.PASSWORD_REQUIREMENTS_MIN_LENGTH", { min: min })
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user