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 + ), })