Skip to content

Commit

Permalink
Add password confirmation
Browse files Browse the repository at this point in the history
Co-authored-by: Victor Santos <[email protected]>
  • Loading branch information
senaarth and victordsantoss committed Sep 24, 2020
1 parent 4dac2c1 commit f27ae46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/schemas/userSchema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Joi = require('joi');

const userSchema = Joi.object({
username: Joi.string().alphanum().min(4).max(30).required(),
password: Joi.string().min(8).required(),
passwordConfirmation: Joi.string().min(8).required().valid(Joi.ref('password')).error(new Error('Password confirmation does not match.')),
email: Joi.string().email().required()
});

module.exports = userSchema;

0 comments on commit f27ae46

Please sign in to comment.