From d82bfd5b56d50c448c62794ee5d4ce1c658dead3 Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Thu, 22 May 2025 12:23:34 -0700 Subject: [PATCH] fix/name allow spaces --- src/auth/authentication.js | 2 +- src/router/user.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth/authentication.js b/src/auth/authentication.js index f89fc41..cd5ee1f 100644 --- a/src/auth/authentication.js +++ b/src/auth/authentication.js @@ -73,7 +73,7 @@ module.exports = (users) => { router.post("/signup", async (req, res) => { const userSchema = joi.object({ email: joi.string().email({ minDomainSegments: 2, tlds: { allow: true } }).required(), - name: joi.string().pattern(new RegExp('^[a-zA-Z]+$')).max(20).required(), + name: joi.string().pattern(new RegExp('^[a-zA-Z0-9_ ]*$')).max(20).required(), password: joi.string().max(20).min(8).required(), repassword: joi.string().max(20).min(8).required(), }); diff --git a/src/router/user.js b/src/router/user.js index d633501..4b15b5c 100644 --- a/src/router/user.js +++ b/src/router/user.js @@ -477,7 +477,7 @@ module.exports = (middleware, users, plans, assets) => { router.post("/updateAccount", async (req, res) => { const accountSchema = joi.object({ email: joi.string().email({ minDomainSegments: 2, tlds: { allow: true } }), - name: joi.string().pattern(new RegExp('^[a-zA-Z]+$')).max(20), + name: joi.string().pattern(new RegExp('^[a-zA-Z0-9_ ]*$')).max(20), password: joi.string().max(20).min(8), repassword: joi.string().max(20).min(8), });