Application Passwords only for admin user? [closed]

Apparently the above code seems to work now. Had to do with a cache? Or maybe the code does not work when you try to connect with an earlier Application Password (a password that was generated before the code was added).

EDIT: For anyone also using the Woocommerce app on the mobile.
The above function will not work, once authenticated. This means it is not possible to obtain the stats with the function above. You can use this function to check the user by ID. This works, if you only want to allow the admin to use Application Passwords and your user ID is 1:

function my_prefix_customize_app_password_availability(
    $available,
    $user
) {
    if ( $user !== 1 ) {
        $available = false;
    }
 
    return $available;
}
 
add_filter(
    'wp_is_application_passwords_available_for_user',
    'my_prefix_customize_app_password_availability',
    10,
    2
);

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduseduedusedueduseduseduedusedus