public void ValidatePasswords(ChangePasswordViewModel viewModel, User currentUser)
        {
            // Check if current password is correct
            bool isValidPassword = userRepository.CheckPassword(currentUser, viewModel.CurrentPassword, true);

            if (!isValidPassword)
            {
                viewModel.AddErrorFor(m => m.CurrentPassword, "Could not verify your current password.");
            }

            // Check if new password is the same as old password
            if (viewModel.HasSuccessfullyParsedValueFor(m => m.NewPassword) &&
                viewModel.HasSuccessfullyParsedValueFor(m => m.CurrentPassword) &&
                viewModel.NewPassword == viewModel.CurrentPassword)
            {
                viewModel.AddErrorFor(
                    m => m.NewPassword,
                    "Your new password cannot be the same as your old password.");
            }

            // Check if new password and confirmation password match
            if (viewModel.HasSuccessfullyParsedValueFor(m => m.NewPassword) &&
                viewModel.HasSuccessfullyParsedValueFor(m => m.ConfirmNewPassword) &&
                viewModel.NewPassword != viewModel.ConfirmNewPassword)
            {
                viewModel.AddErrorFor(
                    m => m.ConfirmNewPassword,
                    "The password and confirmation do not match.");
            }
        }