$secure_cookie =
apply_filters( 'secure_signon_cookie',
$secure_cookie,
$credentials );
global $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie().
$auth_secure_cookie =
$secure_cookie;
add_filter( 'authenticate', 'wp_authenticate_cookie', 30, 3
);
$user =
wp_authenticate( $credentials['user_login'
],
$credentials['user_password'
] );
if ( is_wp_error( $user ) ) { return $user;
} wp_set_auth_cookie( $user->ID,
$credentials['remember'
],
$secure_cookie );
/**
* Fires after the user has successfully logged in.
*
* @since 1.5.0
*
* @param string $user_login Username.
* @param WP_User $user WP_User object of the logged-in user.
*/