webupdatev1
This commit is contained in:
@@ -31,9 +31,7 @@ const validators = {
|
||||
.withMessage("Valid email is required")
|
||||
.normalizeEmail()
|
||||
.trim(),
|
||||
body("password")
|
||||
.isLength({ min: 8 })
|
||||
.withMessage("Password must be at least 8 characters"),
|
||||
body("password").notEmpty().withMessage("Password is required").trim(),
|
||||
],
|
||||
|
||||
// User validators
|
||||
@@ -51,10 +49,10 @@ const validators = {
|
||||
)
|
||||
.trim(),
|
||||
body("password")
|
||||
.isLength({ min: 8 })
|
||||
.matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/)
|
||||
.isLength({ min: 12 })
|
||||
.matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#])/)
|
||||
.withMessage(
|
||||
"Password must be at least 8 characters with uppercase, lowercase, and number"
|
||||
"Password must be at least 12 characters with uppercase, lowercase, number, and special character"
|
||||
),
|
||||
body("role_id").notEmpty().withMessage("Role is required").trim(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user