Add form validation for login and registration