Encapsulating of service layer from Password Encoder
<p>In my service layer I have method wich updates email:</p>

<pre><code>@Override
public void updateUserEmail(String email, String newEmail, String password) throws InvalidPasswordException, DuplicateEmailException {

    Client client = getSpecializedUserByEmail(email);
        /*....*/
}
</code></pre>

<p><strong>password</strong> - is entered by user, but for checking if it matches to real, I must use <strong>BCryptPasswordEncoder</strong> in my service layer - but it is violation of encapsulation of service layer.
I can use checking of password in controller - but it is bad practice.
Help please, I will be very grateful)</p>