From fd2c1b98bad64fba43324120c524bb7fb3728a0e Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Tue, 23 May 2023 14:56:59 +0800 Subject: [PATCH] actually fix pubnix uppercase username thing --- src/routes/pubnix/register/+page.server.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/pubnix/register/+page.server.ts b/src/routes/pubnix/register/+page.server.ts index 73feced..29f3f69 100644 --- a/src/routes/pubnix/register/+page.server.ts +++ b/src/routes/pubnix/register/+page.server.ts @@ -15,8 +15,10 @@ export const actions: Actions = { const BodyTypeSchema = Joi.object({ username: Joi.string() .required() - .alphanum() - .lowercase(), + .pattern( + /^[a-z_][a-z0-9_]{0,20}$/ + ) + .message("Invalid username ([A-Za-z0-9_])"), email: Joi.string().email().required(), ssh: Joi.string() .required()