From 64085c6be56e258868725082fc7253400c4d5759 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Sun, 28 Sep 2025 06:58:21 +0100 Subject: [PATCH] added alphanumeric validation for url name --- src/component/profile_complete/ProfileCompleteCom.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/component/profile_complete/ProfileCompleteCom.jsx b/src/component/profile_complete/ProfileCompleteCom.jsx index 7f50c5c..1c8db04 100644 --- a/src/component/profile_complete/ProfileCompleteCom.jsx +++ b/src/component/profile_complete/ProfileCompleteCom.jsx @@ -21,7 +21,10 @@ const validationSchema = Yup.object().shape({ otherwise: (schema) => schema, }), introduction: Yup.string().min(1, "Minimum 1 character").max(50, "Maximum 50 characters"), - url_name: Yup.string().min(6, "Minimum 6 characters").max(16, "Maximum 16 characters").required("Required"), + url_name: Yup.string().min(6, "Minimum 6 characters").max(16, "Maximum 16 characters").required("Required").matches( + /^[a-zA-Z0-9]+$/, // Regex for alphanumeric characters + 'Must contain only alphanumeric characters' // Custom error message + ), }) -- 2.34.1