Note this is NOT the username, but the key identifier name
$api_name = false;
$hashed_passwords = \WP_Application_Passwords::get_user_application_passwords( $user->ID );
foreach ( $hashed_passwords as $item ) {
if ( ! \WP_Application_Passwords::check_password( $password, $item['password'] ) ) {
continue;
}
$api_name = $item['name'];
break;
}
Leave a Reply