mirror of
https://github.com/strapi/strapi.git
synced 2025-07-28 03:20:17 +00:00
21 lines
502 B
JavaScript
21 lines
502 B
JavaScript
'use strict';
|
|
|
|
const { yup, formatYupErrors } = require('strapi-utils');
|
|
const validators = require('../common-validators');
|
|
|
|
const forgotPasswordSchema = yup
|
|
.object()
|
|
.shape({
|
|
email: validators.email.required(),
|
|
})
|
|
.required()
|
|
.noUnknown();
|
|
|
|
const validateForgotPasswordInput = data => {
|
|
return forgotPasswordSchema
|
|
.validate(data, { strict: true, abortEarly: false })
|
|
.catch(error => Promise.reject(formatYupErrors(error)));
|
|
};
|
|
|
|
module.exports = validateForgotPasswordInput;
|