Skip to content

Commit

Permalink
Remove domain check
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethmv committed Dec 5, 2023
1 parent c33c00a commit 0f1f54c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export function getUserExperienceFlow(): ?string {
}

export function getSDKToken(): ?string {
return isPayPalDomain() ? getSDKAttribute(SDK_SETTINGS.SDK_TOKEN) : "";
return getSDKAttribute(SDK_SETTINGS.SDK_TOKEN);
}

// whether in zoid window
Expand Down
16 changes: 16 additions & 0 deletions test/client/scriptUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
getCSPNonce,
getEnableThreeDomainSecure,
getUserExperienceFlow,
getSDKToken,
isChildWindow,
} from "../../src/script";
import { insertMockSDKScript } from "../../src";
Expand Down Expand Up @@ -162,6 +163,21 @@ describe(`script utils cases`, () => {
}
});

it("getSDKToken should return a sdk-token string", () => {
insertMockSDKScript({
attributes: {
"data-sdk-client-token": "sdk-token",
},
});
const result = getSDKToken();

if (result !== "sdk-token") {
throw new Error(
`should return the "sdk-token" word, but got: ${String(result)}`
);
}
});

it("getCSPNonce should return a data-csp-nonce string", () => {
insertMockSDKScript({
attributes: {
Expand Down

0 comments on commit 0f1f54c

Please sign in to comment.