mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Do not add data-client-token
to the script if there is no user
This commit is contained in:
parent
4b50f8caeb
commit
eef459df58
1 changed files with 6 additions and 1 deletions
|
@ -25,6 +25,11 @@ const storeToken = (token) => {
|
|||
}
|
||||
|
||||
const dataClientIdAttributeHandler = (script, config) => {
|
||||
if(config.user === 0) {
|
||||
document.body.append(script);
|
||||
return;
|
||||
}
|
||||
|
||||
const token = storedTokenForUser(config.user);
|
||||
if (token) {
|
||||
script.setAttribute('data-client-token', token);
|
||||
|
@ -49,4 +54,4 @@ const dataClientIdAttributeHandler = (script, config) => {
|
|||
});
|
||||
}
|
||||
|
||||
export default dataClientIdAttributeHandler;
|
||||
export default dataClientIdAttributeHandler;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue