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), });