Skip to content

Commit

Permalink
fix(users): review schema & /me return 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil committed May 5, 2020
1 parent 7a373b8 commit 206902f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ exports.me = (req, res) => {
email: escape(req.user.email),
lastName: escape(req.user.lastName),
firstName: escape(req.user.firstName),
bio: escape(req.user.bio),
additionalProvidersData: req.user.additionalProvidersData,
};
}
Expand Down
4 changes: 2 additions & 2 deletions modules/users/models/user.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const UserSchema = Joi.object().keys({
lastName: Joi.string().alphanum().min(1).max(30)
.trim()
.required(),
bio: Joi.string().alphanum().min(1).max(200)
bio: Joi.string().max(200)
.trim()
.default('')
.allow('')
.optional(),
email: Joi.string().email({ minDomainAtoms: 2 }),
avatar: Joi.string().trim().default(''),
Expand Down

0 comments on commit 206902f

Please sign in to comment.