mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-29 10:17:30 +08:00
impr(server): disallow dots in tags, presets and custom theme names
This commit is contained in:
parent
dd4943bae0
commit
8c00315c5b
2 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ const router = Router();
|
|||
const presetNameSchema = joi
|
||||
.string()
|
||||
.required()
|
||||
.regex(/^[0-9a-zA-Z_.-]+$/)
|
||||
.regex(/^[0-9a-zA-Z_-]+$/)
|
||||
.max(16)
|
||||
.messages({
|
||||
"string.pattern.base": "Invalid preset name",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const router = Router();
|
|||
const tagNameValidation = joi
|
||||
.string()
|
||||
.required()
|
||||
.regex(/^[0-9a-zA-Z_.-]+$/)
|
||||
.regex(/^[0-9a-zA-Z_-]+$/)
|
||||
.max(16)
|
||||
.messages({
|
||||
"string.pattern.base":
|
||||
|
|
@ -29,7 +29,7 @@ const tagNameValidation = joi
|
|||
const customThemeNameValidation = joi
|
||||
.string()
|
||||
.max(16)
|
||||
.regex(/^[0-9a-zA-Z_.-]+$/)
|
||||
.regex(/^[0-9a-zA-Z_-]+$/)
|
||||
.required()
|
||||
.messages({
|
||||
"string.max": "The name must not exceed 16 characters",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue