routes/login.js
// Defining a Checking Schema for the SignUp Body
Defining a Checking Schema for the SignUp Body
Defining a Checking Schema for the SignUp Body
function validateUser(user) {
  const schema = Joi.object({
    email: Joi.string().min(5).max(255).required().email(),
    password: passwordComplexity({
      min: 8,
      max: 1024,
      lowerCase: 1,
      upperCase: 1,
      numeric: 1,
      symbol: 0,
      requirementCount: 4
    }).required()
  });
  return schema.validate(user);
}
function validateUser ( user ) { const schema = Joi . object ( { email : Joi . string ( ) . min ( 5 ) . max ( 255 ) . required ( ) . email ( ) , password : passwordComplexity ( { min : 8 , max : 1024 , lowerCase : 1 , upperCase : 1 , numeric : 1 , symbol : 0 , requirementCount : 4 } ) . required ( ) } ) ; return schema . validate ( user ) ; }
Defining a Checking Schema for the SignUp Body
Defining a Checking Schema for the SignUp Body