Validation for signup and login form.