mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
added the dot (.) username rules (#787)
This commit is contained in:
parent
91d32fa4f6
commit
1aa4b34dc6
2 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@ const userSchema = mongoose.Schema(
|
||||||
type: String,
|
type: String,
|
||||||
lowercase: true,
|
lowercase: true,
|
||||||
required: [true, 'can\'t be blank'],
|
required: [true, 'can\'t be blank'],
|
||||||
match: [/^[a-zA-Z0-9_-]+$/, 'is invalid'],
|
match: [/^[a-zA-Z0-9_.-]+$/, 'is invalid'],
|
||||||
index: true,
|
index: true,
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
|
@ -177,7 +177,7 @@ module.exports.validateUser = (user) => {
|
||||||
username: Joi.string()
|
username: Joi.string()
|
||||||
.min(2)
|
.min(2)
|
||||||
.max(80)
|
.max(80)
|
||||||
.regex(/^[a-zA-Z0-9_-]+$/)
|
.regex(/^[a-zA-Z0-9_.-]+$/)
|
||||||
.required(),
|
.required(),
|
||||||
password: Joi.string().min(8).max(128).allow('').allow(null),
|
password: Joi.string().min(8).max(128).allow('').allow(null),
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@ const registerSchema = Joi.object().keys({
|
||||||
.trim()
|
.trim()
|
||||||
.min(2)
|
.min(2)
|
||||||
.max(20)
|
.max(20)
|
||||||
.regex(/^[a-zA-Z0-9_-]+$/)
|
.regex(/^[a-zA-Z0-9_.-]+$/)
|
||||||
.required(),
|
.required(),
|
||||||
email: Joi.string().trim().email().required(),
|
email: Joi.string().trim().email().required(),
|
||||||
password: Joi.string().trim().min(8).max(128).required(),
|
password: Joi.string().trim().min(8).max(128).required(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue