diff --git a/src/schemas.ts b/src/schemas.ts index b9630ba..4e62f96 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -3,7 +3,9 @@ import * as Yup from "yup"; const REQUIRED = "Required."; const USERNAME = Yup.string() .required(REQUIRED) - .min(1, "Username is too short."); + .min(1, "Username is too short.") + .matches(/^[a-z0-9]+$/, "Username must be lowercase letters and numbers."); + const DISPLAY_NAME = Yup.string() .required(REQUIRED) .min(1, "Display name is too short.");