From fbe2222d1b06235ae82566664f748c3fe3eb08d9 Mon Sep 17 00:00:00 2001 From: NotNite Date: Sat, 29 Apr 2023 16:32:59 -0400 Subject: [PATCH] thanks naku --- src/schemas.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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.");