Code review. Add network validation to log in