2020-05-18 19:54:43 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const { yup } = require('strapi-utils');
|
|
|
|
|
|
|
|
const validators = {
|
2020-05-18 20:39:39 +02:00
|
|
|
email: yup
|
2020-05-18 19:54:43 +02:00
|
|
|
.string()
|
2020-05-18 20:39:39 +02:00
|
|
|
.email()
|
|
|
|
.min(1),
|
|
|
|
firstname: yup.string().min(1),
|
|
|
|
lastname: yup.string().min(1),
|
2020-05-18 19:54:43 +02:00
|
|
|
password: yup
|
|
|
|
.string()
|
|
|
|
.min(8)
|
|
|
|
.matches(/[a-z]/, '${path} must contain at least one lowercase character')
|
|
|
|
.matches(/[A-Z]/, '${path} must contain at least one uppercase character')
|
2020-05-18 20:39:39 +02:00
|
|
|
.matches(/\d/, '${path} must contain at least one number'),
|
2020-05-18 19:54:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = validators;
|