plugabble wp_authenticate function not works from wp-login.php

I found the problem, the login procedure pre-loads the USER object in cache.

The password that is checked is always the initial one: changing the password in the database only works from the next login attempt.
I fixed it by adding

clean_user_cache($userId)

But I don’t understand why if I try to login from the “my account” page, the user cache is not considered.

Maybe it’s because of the absence of the “remember me?” flag.