Get API password key name

By.

min read

My profile

Share this:

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;
            }
Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *