validator for login and sign up