school-wcwt / csci_3100

0 stars 1 forks source link

Registration Data Validation and Test #4

Open jonathan-lph opened 3 years ago

jonathan-lph commented 3 years ago

Need to check user's input as valid, e.g. username in [A-Z, a-z, 0-9, -_].

school-wcwt commented 3 years ago

added user name and password validation on the registration page

Rule:

  1. The confirmed password must match with password
  2. Password and User Name can only be [A-Z, a-z, 0-9]
  3. Password must be larger > 5 letters
school-wcwt commented 3 years ago

@jonathan-lph Request for an issue close if no problem

jonathan-lph commented 3 years ago

Password also [A-Z, a-z, 0-9]? User name can add '_' '-'.

jonathan-lph commented 3 years ago

Please also check Rest username. If English name is provided, replace space to '-' as username. If ONLY Chinese name is provided, replace Chinese name space to '-' as username.

if (type == 'Rest') 
    username = input.username != null 
        ? input.username.replace(/ /g, '-') // English name replace space to -
        : input.name.replace(/ /g, '-')  // Chinese name replace space to -
school-wcwt commented 3 years ago

Password also [A-Z, a-z, 0-9]? User name can add '_' '-'.

For user name can be letters, digits, - and _ For pw can be letters and digits only