fix/enhanced user input validation

This commit is contained in:
SowinskiBraeden committed 2025-05-09 10:29:20 -07:00
1 parent 1f742d41c3
commit 69fd776c0f
3 files changed
+8 -8

No files matched your search

+3 -3
View File
@@ -311,9 +311,9 @@ module.exports = (middleware, users, plans, assets) => {
router.post("/updateAccount", async (req, res) => {
const accountSchema = joi.object({
email: joi.string().email(),
name: joi.string().alphanum().max(20),
password: joi.string().max(20).min(8),
repassword: joi.string().max(20).min(8),
name: joi.string().pattern(new RegExp('^[a-zA-Z]+$')).max(20),
password: joi.string().alphanum().max(20).min(8),
repassword: joi.string().alphanum().max(20).min(8),
});
const valid = accountSchema.validate(req.body);