diff --git a/src/router/index.js b/src/router/index.js index d23d15c38..04c934769 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -171,12 +171,13 @@ router.beforeEach(async (to, from, next) => { } const toQueryPage = to.query?.fmgPage; - const notToPIAReturn = toQueryPage != "payment-pia-return"; + const notToPIAReturn = toQueryPage != fmgPageValues.PAYMENT_PIA_RETURN; const isInIframe = window !== window.top; // fromPaymentToConfirmation workaround for navigating from an iframe but // isInIframe evaluates to false for some reason when navigating from payment to confirmation - const fromPaymentToConfirmation = fromQueryPage === "payment" && toQueryPage === "confirmation"; + const fromPaymentToConfirmation = + fromQueryPage === fmgPageValues.PAYMENT && toQueryPage === fmgPageValues.CONFIRMATION; if ((isInIframe && notToPIAReturn) || fromPaymentToConfirmation) { const newUrl = `${window.top.location.origin}${to.href}`;