public void UpdateUserCredentials(IList<UserAuthentication> authCollection, UpdateCredentials credentials)
 {
     var actualAccount = authCollection.First(x => x.AccountType == AccountType.ActualAccount);
     var newPassword = EncryptionHandler.Encrypt(credentials.NewPassword, actualAccount.EncryptionKey);
     actualAccount.EncodedPassword = newPassword;
     _userAuthUpdater.Update(actualAccount);
 }
        public AuthenticationResult ChangePassword(UpdateCredentials credentials)
        {
            try
            {
                var user = GetUser(credentials.Email);
                var authCollection = GetUserAuthCollection(user);
                var validateResult = ValidateCredentials(authCollection, credentials.Password);

                if (validateResult == ValidateResult.Valid)
                {
                    UpdateUserCredentials(authCollection, credentials);
                    return new AuthenticationResult
                    {
                        WasSuccessful = true,
                        UserAccount = _translateDataUserToUserAccount.Translate(user)
                    };
                }
            }
            catch (Exception ex)
            {
                //TODO: Do Logging
            }

            return new AuthenticationResult
            {
                WasSuccessful = false
            };
        }