From d2f9ea3beab817df0fae60835b119f5518670072 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Fri, 5 Jun 2026 12:16:39 -0400 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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; } } - } } -}; + };