dfout / HeapLeak

2 stars 0 forks source link

Sign Up Form Validations: #9

Open zach-gold opened 2 weeks ago

zach-gold commented 2 weeks ago

Noticing that I can sign up a new user with SINGLE character values in ALL of the form fields. Going to leave some general Form Validation Notes, below.

  1. Would recommend a minimum password length of 8 for security reasons.
  2. Would recommend a regex for your email validator! OR write your own validator if that makes sense.
  3. ALL form input fields should have both a MINIMUM and MAXIMUM value that is being tested for and that you should render the appropriate error messages when the user enters invalid data so that it is clear what they need to do to proceed! Ideally, each message would render above or below the input that it specifically refers to and should convey the bounds of that input.

BEST PRACTICE: You should have Form input validations on the Frontend AND the backend. No need to send data to the back when it does not pass muster. Additionally, once an application has heavy traffic, sending the error responses unecessarily from the backend can actually become costly. And as user (probably hacker) does not need your UI to access your backend, we need to protect the database with good validations there as well. WTForms makes this easy.

zach-gold commented 2 weeks ago

Validators are up and running, min and max length constraints as well as regex for email string validation have been added. need second set of eyes to confirm. submission is blocked across all forms if the validators throw any errors.

zach-gold commented 2 weeks ago

Brian has tested and confirmed passing functionality, validation messages just have to be styled and this can be closed