Files
NetDomainManager/validators/register.js
T

13 lines
481 B
JavaScript
Raw Normal View History

2026-05-13 19:27:59 -04:00
const Joi = require('joi');
const userCreateSchema = Joi.object().keys({
register_username: Joi.string().alphanum().min(3).max(24).required(),
register_password: Joi.string().min(8).max(256).required(),
register_confirm_password: Joi.any().valid(Joi.ref('register_password')).required().messages({'any.only': 'Passwords must match.'})
// token later
}).unknown(true);
module.exports = {
test: (body) => {
return userCreateSchema.validate(body);
}
}