Skip to content

Commit 5f28077

Browse files
committed
fix: merge
2 parents 3fa2f08 + 7f5c930 commit 5f28077

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/common/network.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const sessionId = self.crypto.randomUUID();
1313
export const getData = async (url: string,
1414
apiKey: string,
1515
sessionKey: string | null) => {
16-
// Validate that the session key is generated by crypto.randomUUID
16+
// Validate that the host is the hosted checkout url if a session key is provided
1717
// If it is not, set it to null
18-
if (sessionKey && !sessionKey.match(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/)) {
18+
if (sessionKey && !hostedCheckoutEndpoint.includes(window.location.host)) {
1919
sessionKey = null;
2020
}
2121

src/components/pay-theory-hosted-field/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ class PayTheoryHostedField extends HTMLElement {
4343
origin: window.location.origin,
4444
styles: this._styles,
4545
placeholders: this._placeholders,
46-
session: this._session,
47-
amount: this._amount,
46+
amount: this._amount
4847
};
4948
const json = JSON.stringify(token);
5049
const encodedJson = window.btoa(json);

0 commit comments

Comments
 (0)