validateInputs(forForm) {
    // Empty or false inputs
    if (this.state.user.username === "" || !this.state.user.username) {
      return false;
    } 
    if (this.state.user.password === "" || !this.state.user.password) {
      return false;
    }
    if (forForm === "signup") {
      if (this.state.user.email === "" || !this.state.user.email) {
        return false;
      } 
      if (this.state.user.firstName === "" || this.state.user.lastName === "") {
        return false;
      }
    }
    return true;
  }
/*  Validate inputs for the User fields for Signin and Sign Up forms
   *  1. Check for empty input                      ~
   *  2. Check for password strength (OWASP regex)  X
   *  3. Check email validity                       X
   *  4. Check for blacklisted words                x
   *  5. Trigger error texts                        x
   */
Validate inputs for the User fields for Signin and Sign Up forms
1. Check for empty input                      ~
2. Check for password strength (OWASP regex)  X
3. Check email validity                       X
4. Check for blacklisted words                x
5. Trigger error texts                        x
Validate inputs for the User fields for Signin and Sign Up forms 1 . Check for empty input ~ 2 . Check for password strength ( OWASP regex ) X 3 . Check email validity X 4 . Check for blacklisted words x 5 . Trigger error texts x
validateInputs(forForm) {
    if (this.state.user.username === "" || !this.state.user.username) {
      return false;
    } 
    if (this.state.user.password === "" || !this.state.user.password) {
      return false;
    }
    if (forForm === "signup") {
      if (this.state.user.email === "" || !this.state.user.email) {
        return false;
      } 
      if (this.state.user.firstName === "" || this.state.user.lastName === "") {
        return false;
      }
    }
    return true;
  }
validateInputs ( forForm ) { if ( this . state . user . username === "" || ! this . state . user . username ) { return false ; } if ( this . state . user . password === "" || ! this . state . user . password ) { return false ; } if ( forForm === "signup" ) { if ( this . state . user . email === "" || ! this . state . user . email ) { return false ; } if ( this . state . user . firstName === "" || this . state . user . lastName === "" ) { return false ; } } return true ; }
Validate inputs for the User fields for Signin and Sign Up forms
  1.
Validate inputs for the User fields for Signin and Sign Up forms 1 .
// Empty or false inputs