Skip to content

Commit

Permalink
removes role for login and length of name and email
Browse files Browse the repository at this point in the history
  • Loading branch information
swarajpure committed Jan 15, 2021
1 parent 095e26c commit 1306c93
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions middlewares/validators/userValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const Joi = require('@hapi/joi');
// validation schema
const registerValidation = (data) => {
const schema = Joi.object({
name: Joi.string().min(6).required(),
email: Joi.string().min(6).required().email(),
name: Joi.string().required(),
email: Joi.string().required().email(),
password: Joi.string().min(6).required(),
role: Joi.string().required()
});
Expand All @@ -13,9 +13,8 @@ const registerValidation = (data) => {

const loginValidation = (data) => {
const schema = Joi.object({
email: Joi.string().min(6).required().email(),
password: Joi.string().min(6).required(),
role: Joi.string().required()
email: Joi.string().required().email(),
password: Joi.string().min(6).required()
});
return schema.validate(data);
};
Expand Down

0 comments on commit 1306c93

Please sign in to comment.