public bool IsUserRegistrated(string email, string password) { byte[] bytePassword = _sHA256HashService.GetSHAFromString(password); UserEntity findUser = _userRepository.GetUserByEmail(password); return(findUser != null && CompareByteArrays(bytePassword, findUser.Password)); }
public int SaveUserFromApp(string registrationUserName, string registrationUserPassword, string userEmail, LoginType loginType) { var user = new UserEntity { Name = registrationUserName, Password = _sHA256Hash.GetSHAFromString(registrationUserPassword), Email = userEmail, TypeUserLogin = LoginType.App }; _userRepository.Insert(user); int userId = user.Id; return(userId); }