mirror of
https://github.com/strapi/strapi.git
synced 2025-07-29 03:50:26 +00:00
24 lines
510 B
JavaScript
24 lines
510 B
JavaScript
'use strict';
|
|
|
|
const { yup } = require('strapi-utils');
|
|
|
|
const validators = {
|
|
firstname: yup
|
|
.string()
|
|
.min(1)
|
|
.required(),
|
|
lastname: yup
|
|
.string()
|
|
.min(1)
|
|
.required(),
|
|
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')
|
|
.matches(/\d/, '${path} must contain at least one number')
|
|
.required(),
|
|
};
|
|
|
|
module.exports = validators;
|