fix(registration): Make Username optional (#831)

* fix(User.js): update validation schema for username field, allow empty string as a valid value
fix(validators.js): update validation schema for username field, allow empty string as a valid value
fix(Registration.tsx, validators.js): update validation rules for name and username fields, change minimum length to 2 and maximum length to 80, assure they match and allow empty string as a valid value
fix(Eng.tsx): update localization string for com_auth_username, indicate that it is optional

* fix(User.js): update regex pattern for username validation to allow special characters @#$%&*()
fix(validators.js): update regex pattern for username validation to allow special characters @#$%&*()

* fix(Registration.spec.tsx): fix validation error message for username length requirement
This commit is contained in:
Danny Avila 2023-08-23 16:14:17 -04:00 committed by GitHub
parent d38e463d34
commit 37347d4683
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 16 deletions

View file

@ -115,13 +115,13 @@ function Registration() {
id="username"
aria-label={localize('com_auth_username')}
{...register('username', {
required: localize('com_auth_username_required'),
// required: localize('com_auth_username_required'),
minLength: {
value: 3,
value: 2,
message: localize('com_auth_username_min_length'),
},
maxLength: {
value: 20,
value: 80,
message: localize('com_auth_username_max_length'),
},
})}