mirror of
https://github.com/strapi/strapi.git
synced 2025-07-12 11:31:38 +00:00
30 lines
713 B
JavaScript
30 lines
713 B
JavaScript
'use strict';
|
|
|
|
const { yup, validateYupSchema } = require('@strapi/utils');
|
|
|
|
const callbackBodySchema = yup.object().shape({
|
|
identifier: yup.string().required(),
|
|
password: yup.string().required(),
|
|
});
|
|
|
|
const registerBodySchema = yup.object().shape({
|
|
email: yup
|
|
.string()
|
|
.email()
|
|
.required(),
|
|
password: yup.string().required(),
|
|
});
|
|
|
|
const sendEmailConfirmationBodySchema = yup.object().shape({
|
|
email: yup
|
|
.string()
|
|
.email()
|
|
.required(),
|
|
});
|
|
|
|
module.exports = {
|
|
validateCallbackBody: validateYupSchema(callbackBodySchema),
|
|
validateRegisterBody: validateYupSchema(registerBodySchema),
|
|
validateSendEmailConfirmationBody: validateYupSchema(sendEmailConfirmationBodySchema),
|
|
};
|