email and user name sign in

move this condition to User model