From d780b544b0ddcda0d76cdfe7bd51bbf50839d33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Gierwia=C5=82o?= Date: Sun, 7 Dec 2025 20:57:03 +0100 Subject: [PATCH] fix(validators): add Polish characters support for first/last name validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ąćęłńóśźżĄĆĘŁŃÓŚŹŻ to regex pattern - Fixes registration rejecting Polish characters in names --- backend/src/middleware/validators.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/middleware/validators.js b/backend/src/middleware/validators.js index bc951aa..220a510 100644 --- a/backend/src/middleware/validators.js +++ b/backend/src/middleware/validators.js @@ -60,14 +60,14 @@ const registerValidation = [ .trim() .isLength({ max: 100 }) .withMessage('First name must be less than 100 characters') - .matches(/^[a-zA-ZÀ-ÿ\s'-]+$/) + .matches(/^[a-zA-ZÀ-ÿąćęłńóśźżĄĆĘŁŃÓŚŹŻ\s'-]+$/) .withMessage('First name contains invalid characters'), body('lastName') .optional() .trim() .isLength({ max: 100 }) .withMessage('Last name must be less than 100 characters') - .matches(/^[a-zA-ZÀ-ÿ\s'-]+$/) + .matches(/^[a-zA-ZÀ-ÿąćęłńóśźżĄĆĘŁŃÓŚŹŻ\s'-]+$/) .withMessage('Last name contains invalid characters'), body('wsdcId') .optional({ nullable: true, checkFalsy: true })