The problem is that wp_signon
function requires password as plain text. Where WP_User
object returns user password as hashed.
There is any way to safety login using user WP_User object? Something like this:
$user = new WP_User(1);
wp_signon([
'user_login' => $user->user_login,
'user_password' => $user->user_pass,
'remember' => true,
]);