made it prettier

This commit is contained in:
ngn 2023-06-11 15:17:03 +03:00
parent 41f14b3ad8
commit e774a9256b

View File

@ -225,13 +225,18 @@ router.post(
} }
if (body.password) { if (body.password) {
const min = register.password.minLength ? register.password.minLength : 8; const min = register.password.minLength
if(body.password.length < min){ ? 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: min }) message: req.t(
} "auth:register.PASSWORD_REQUIREMENTS_MIN_LENGTH",
{ min: min },
),
},
}); });
} }
// the salt is saved in the password refer to bcrypt docs // the salt is saved in the password refer to bcrypt docs