From 6add3027f4d24bbc815f95990a29993008905312 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Thu, 4 Jun 2026 11:18:15 -0400 Subject: [PATCH 1/9] Added referral seq number and parent account number to log-custom-event. --- src/store/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 20bc7261..0dbf8c29 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2596,7 +2596,7 @@ export const useMainStore = defineStore({ } ); }, - async logCustomEvent({ userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId, experimentsForUser }) { + async logCustomEvent({ userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId, experimentsForUser, referralSequenceNumber, parentAccountNumber }) { if (pageName == null || pageName.length === 0) { pageName = 'none'; } const payload = { @@ -2610,7 +2610,9 @@ export const useMainStore = defineStore({ label, value, shouldUseSessionId, - experimentsForUser + experimentsForUser, + referralSequenceNumber, + parentAccountNumber }; return globalMethods.callHttpClient({ From d6efb4ec32ad1572071f7326595243d71ab9c04f Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Thu, 4 Jun 2026 12:13:43 -0400 Subject: [PATCH 2/9] Fixed issue with missing ref seq number and parent account number on log-custom-event service calls. --- src/mixins/analytics-mixin.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index d3c139c7..bb8dc439 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -95,15 +95,23 @@ export default { async logCustomEvent(category, action, label, value) { const store = useMainStore(); + const issConfig = store.issConfig; const currentPageName = this.getPageNameByQueryString(); //await this.validateSession(); + const submittedOrder = store.getSubmittedOrder(); + const hasSubmittedOrder = store.hasSubmittedOrder(); + const order = hasSubmittedOrder ? submittedOrder : store.order; + + // Use parentaccount on order, use parentaccount on issconfig as fallback. + const parentAccountNumber = (order.parentAccountNumber ?? issConfig.parentAccountNumber); + const payload = { userId: getUserIdValue(), sessionKey: getSessionKeyValue(), pageName: currentPageName, - referralSequenceNumber: store.order.referralSequenceNumber, - parentAccountNumber: store.order.parentAccountNumber ?? 0, + referralSequenceNumber: order.referralSequenceNumber, + parentAccountNumber: parentAccountNumber, sessionId: getSessionIdValue(), category, action, From d2f9ea3beab817df0fae60835b119f5518670072 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Fri, 5 Jun 2026 12:16:39 -0400 Subject: [PATCH 3/9] Fix for missing pre-populated fields upon successful client signature validation. --- src/layouts/entry-page/entry-page.vue | 53 +++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index a87f81c8..09670247 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -130,15 +130,27 @@ export default { let isAuthorized = false; let clientData = null; const decryptedParams = {}; + const encryptedParametersPattern = this.mainStore.issConfig.encryptedParametersPattern; + console.log("Encrypted Parameters Pattern from config: ", encryptedParametersPattern); if (resp.active && resp.accountName.length > 0) { if (resp.authentication.startsWith('RSAToken')) { const { token, signature } = queryStringParams; const vsigResp = await validateISSClientSignature(clientTag, token, signature); - if (resp.authentication.includes('EncParams')) { - const params = new URLSearchParams(vsigResp.decryptedData); - for (const [key, value] of params) { - decryptedParams[key.toLowerCase()] = value; + + if (resp.authentication.includes('EncParams') && encryptedParametersPattern) { + try { + const match = vsigResp.decryptedData.match(encryptedParametersPattern); + + if ( match ) { + const params = match.groups; + for (const [key, value] of Object.entries(params)) { + decryptedParams[key.toLowerCase()] = value; + } + } + } + catch ( error ) { + global.$logger.logError(`[Entry Page] Unable to populate encrypted parameters: ${error} - Client Tag: ${clientTag} - Token: ${token} - Signature: ${signature}`); } } @@ -197,6 +209,10 @@ export default { if (clientFlags.EnableNoCompQuote) { this.mainStore.issConfig.enableNoCompQuote = true; } + + if ( clientFlags.EncryptedParametersPattern != null ) { + this.mainStore.issConfig.encryptedParametersPattern = clientFlags.EncryptedParametersPattern; + } } }, combineClientParameters(configParams, queryStringParams) { @@ -233,10 +249,14 @@ export default { break; case 'dateofloss': - case 'lossdate': - // NOTE: May need some date parsing logic in here depending on client. - this.mainStore.order.policy.dateOfLoss = value; - this.mainStore.issConfig.disabledFields.dateOfLoss = true; + case 'lossdate': + const formattedDate = this.formatToYYYYMMDD(value); + + // Only set this if it formatted correctly. + if ( formattedDate ) { + this.mainStore.order.policy.dateOfLoss = formattedDate; + this.mainStore.issConfig.disabledFields.dateOfLoss = true; + } break; case 'returnurl': @@ -257,6 +277,23 @@ export default { default: } } + }, + formatToYYYYMMDD(dateString) { + var returnValue = null; + + try { + const date = new Date(dateString); + + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, "0"); + const day = String(date.getDate()).padStart(2, "0"); + + returnValue = `${year}-${month}-${day}`; + } catch ( error ) { + global.$logger.logError(`[Entry Page] Error formatting date string: ${error} - Input: ${dateString}`); + } + + return returnValue; } } }; From 53fb11e9c24405956b2f754e41a3649f6f6f4a92 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Fri, 5 Jun 2026 15:01:10 -0400 Subject: [PATCH 4/9] Force date formatting to stay in UTC. --- src/layouts/entry-page/entry-page.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 09670247..117d1e81 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -282,11 +282,12 @@ export default { var returnValue = null; try { + // Avoid any UTC / local time issues by always treating the input and output as UTC. const date = new Date(dateString); - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, "0"); - const day = String(date.getDate()).padStart(2, "0"); + const year = date.getUTCFullYear(); + const month = String(date.getUTCMonth() + 1).padStart(2, "0"); + const day = String(date.getUTCDate()).padStart(2, "0"); returnValue = `${year}-${month}-${day}`; } catch ( error ) { From 843caaf01fe734134f1f757b806bcaa0d1724835 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Fri, 5 Jun 2026 15:01:39 -0400 Subject: [PATCH 5/9] Fix unit test for decrypted / encrypted parameters. --- src/layouts/entry-page/entry-page.spec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layouts/entry-page/entry-page.spec.js b/src/layouts/entry-page/entry-page.spec.js index 442e2067..7eb03aff 100644 --- a/src/layouts/entry-page/entry-page.spec.js +++ b/src/layouts/entry-page/entry-page.spec.js @@ -113,7 +113,10 @@ describe('entry-page.vue', () => { parentAccountNumber: 'P', styleSheet: '', coverageEnabled: true, - siteType: '' + siteType: '', + clientFlags: JSON.stringify({ + EncryptedParametersPattern: 'foo=(?[^&]+)&from=(?[^&]+)' + }) }; const decryptedData = 'foo=bar&from=yesterday'; jest.spyOn(clientAuthHelper, 'validateISSClientTag').mockResolvedValueOnce(resp); From 27cc78ede509335e8e0e63ed33fa5f178ca26897 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Mon, 8 Jun 2026 11:09:19 -0400 Subject: [PATCH 6/9] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/layouts/entry-page/entry-page.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 117d1e81..1ac3d664 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -279,22 +279,27 @@ export default { } }, formatToYYYYMMDD(dateString) { - var returnValue = null; - try { - // Avoid any UTC / local time issues by always treating the input and output as UTC. + if (!dateString) { + return null; + } + + // Avoid any UTC / local time issues by always treating the output as UTC. const date = new Date(dateString); + if (Number.isNaN(date.getTime())) { + return null; + } const year = date.getUTCFullYear(); const month = String(date.getUTCMonth() + 1).padStart(2, "0"); const day = String(date.getUTCDate()).padStart(2, "0"); - returnValue = `${year}-${month}-${day}`; + return `${year}-${month}-${day}`; } catch ( error ) { global.$logger.logError(`[Entry Page] Error formatting date string: ${error} - Input: ${dateString}`); + return null; } - - return returnValue; + } } } }; From bd2dc84e6b3e6e5d0db350ca8684625cc34a51a3 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Mon, 8 Jun 2026 11:10:57 -0400 Subject: [PATCH 7/9] Removed console log line. --- src/layouts/entry-page/entry-page.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 1ac3d664..4c5f84c2 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -131,7 +131,6 @@ export default { let clientData = null; const decryptedParams = {}; const encryptedParametersPattern = this.mainStore.issConfig.encryptedParametersPattern; - console.log("Encrypted Parameters Pattern from config: ", encryptedParametersPattern); if (resp.active && resp.accountName.length > 0) { if (resp.authentication.startsWith('RSAToken')) { From 5e686581db2e575b008d033e5d7e7d057aa2154a Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Mon, 8 Jun 2026 11:24:05 -0400 Subject: [PATCH 8/9] Refactored some code. --- src/layouts/entry-page/entry-page.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 4c5f84c2..bdbe78ae 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -136,12 +136,16 @@ export default { if (resp.authentication.startsWith('RSAToken')) { const { token, signature } = queryStringParams; const vsigResp = await validateISSClientSignature(clientTag, token, signature); - + + // Encrypted params only populated if the authentication type includes EncParams and we have a pattern to pull them out of the decrypted data. + // Try/Catch is here to ensure that any issues with populating these parameters does not impact the overall authentication/authorization of the client. + // They can fallback to manually entering the data on the webpage. if (resp.authentication.includes('EncParams') && encryptedParametersPattern) { try { - const match = vsigResp.decryptedData.match(encryptedParametersPattern); + const encryptedParametersPatternRegex = RegExp(encryptedParametersPattern); + const match = vsigResp.decryptedData.match(encryptedParametersPatternRegex); - if ( match ) { + if ( match?.groups ) { const params = match.groups; for (const [key, value] of Object.entries(params)) { decryptedParams[key.toLowerCase()] = value; @@ -299,9 +303,8 @@ export default { return null; } } - } } -}; + };