Do not localize id token for guest users

This commit is contained in:
Emili Castells Guasch 2024-05-29 17:33:55 +02:00
parent ed3a48e520
commit 3f1f59090c

View file

@ -84,6 +84,10 @@ class SavePaymentMethodsModule implements ModuleInterface {
add_filter(
'woocommerce_paypal_payments_localized_script_data',
function( array $localized_script_data ) use ( $c ) {
if ( ! is_user_logged_in() ) {
return $localized_script_data;
}
$api = $c->get( 'api.user-id-token' );
assert( $api instanceof UserIdToken );