Skip to content

Commit

Permalink
fix: do not check window.parent.location.href (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamssokari authored Jun 29, 2023
1 parent aadf460 commit d8caa50
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/js/basic-kyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var basicKyc = (function basicKyc() {
production: "https://api.smileidentity.com",
};

const referenceWindow = window.parent.location.href.includes('product-selection') ? window.parent.parent : window.parent;
const referenceWindow = window.parent;

var pages = [];
var config;
Expand Down
2 changes: 1 addition & 1 deletion src/js/biometric-kyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var biometricKyc = function biometricKyc() {
production: 'https://api.smileidentity.com/v1'
}

const referenceWindow = window.parent.location.href.includes('product-selection') ? window.parent.parent : window.parent;
const referenceWindow = window.parent;

var pages = [];
var config;
Expand Down
2 changes: 1 addition & 1 deletion src/js/consent-screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ class EndUserConsent extends HTMLElement {
}

closeWindow() {
const referenceWindow = window.parent.location.href.includes('product-selection') ? window.parent.parent : window.parent;
const referenceWindow = window.parent;
referenceWindow.postMessage('SmileIdentity::Close', '*');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/doc-verification.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var documentVerification = function documentVerification() {
'production': 'https://api.smileidentity.com/v1'
}

const referenceWindow = window.parent.location.href.includes('product-selection') ? window.parent.parent : window.parent;
const referenceWindow = window.parent;

var config;
var activeScreen;
Expand Down
2 changes: 1 addition & 1 deletion src/js/ekyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var eKYC = function eKYC() {
production: 'https://api.smileidentity.com/v1'
}

const referenceWindow = window.parent.location.href.includes('product-selection') ? window.parent.parent : window.parent;
const referenceWindow = window.parent;

var pages = [];
var config;
Expand Down
2 changes: 1 addition & 1 deletion src/js/smartselfie-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var SmartSelfie = (function SmartSelfie() {
production: "https://api.smileidentity.com/v1",
};

const referenceWindow = window.parent.location.href.includes('product-selection') ? window.parent.parent : window.parent;
const referenceWindow = window.parent;

const labels = {
2: {
Expand Down
2 changes: 1 addition & 1 deletion src/js/totp-consent-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ class TotpBasedConsent extends HTMLElement {
}

closeWindow() {
const referenceWindow = window.parent.location.href.includes('product-selection') ? window.parent.parent : window.parent;
const referenceWindow = window.parent;
referenceWindow.postMessage("SmileIdentity::Close", "*");
}

Expand Down

0 comments on commit d8caa50

Please sign in to comment.