Browse Source

Fix celebrate only accepting strings as password

main
Haris Razis 4 years ago
parent
commit
1fd3bb9b47
  1. 20
      server/schemas/joi.js

20
server/schemas/joi.js

@ -1,7 +1,7 @@
const {Joi} = require('celebrate'); const {Joi} = require('celebrate');
const guid = { const guid = {
params:{ params: {
userId: Joi.string().guid().required() userId: Joi.string().guid().required()
} }
} }
@ -14,14 +14,18 @@ const userAuthSchema = {
}; };
const userUpdateSchema = { const userUpdateSchema = {
body: { body: {
_id: Joi.string().required(), _id: Joi.string().required(),
username: Joi.string().required(), username: Joi.string().required(),
email: Joi.any(), __v: Joi.number().integer(),
password: Joi.string().allow(''), email: Joi.string().email(),
newPassword: Joi.string().allow(''), registered: Joi.string(),
lastLogin: Joi.string(),
password: Joi.string().alphanum().allow(''),
newPassword: Joi.string().alphanum().allow(''),
}
} }
}; ;
const athleteUpdateSchema = { const athleteUpdateSchema = {
body: { body: {

Loading…
Cancel
Save