diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index cb1538e3..d1890d70 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -60,13 +60,27 @@ export default { const resp = await validateISSClientTag(clientTag); if (resp?.data.active && resp?.data.accountName.length > 0) { - await this.populateISSConfigValues(resp.data, clientTag, queryStringParams.token, queryStringParams.signature); + if (resp.data.authentication === 'RSAToken') { + const token = queryStringParams.token; + const signature = queryStringParams.signature; - authorized = true; + const vsigResp = await validateISSClientSignature(clientTag, token, signature); + this.mainStore.issConfig.isAuthenticated = vsigResp?.data.valid ?? false; - if (resp.data.parameters?.length > 0) { - const finalParams = this.combineClientParameters(resp.data.parameters, queryStringParams); - this.populateStoreItemsFromParams(finalParams); + if (this.mainStore.issConfig.isAuthenticated) { + authorized = true; + } + } else { + authorized = true; + } + + if (authorized) { + await this.populateISSConfigValues(resp.data); + + if (resp.data.parameters?.length > 0) { + const finalParams = this.combineClientParameters(resp.data.parameters, queryStringParams); + this.populateStoreItemsFromParams(finalParams); + } } } } @@ -78,21 +92,13 @@ export default { window.location = `/?issPage=${issPageValues.WELCOME_PAGE}`; } }, - async populateISSConfigValues(data, clientTag, token, signature) { + async populateISSConfigValues(data) { this.mainStore.issConfig.clientName = data.accountName; this.mainStore.issConfig.clientDisplayName = data.accountName; // Defaults to use the client name. this.mainStore.issConfig.accountNumber = data.accountNumber; this.mainStore.issConfig.styleSheet = data.styleSheet; this.mainStore.issConfig.isCoverageEnabled = data.coverageEnabled; - // NOTE: This is only here for testing purposes. - // Will be removed and replaced by actual token / signature validation when work is completed. - if (data.authentication === 'RSAToken') { - const resp = await validateISSClientSignature(clientTag, token, signature); - console.log(resp.data); - this.mainStore.issConfig.isAuthenticated = resp?.valid ?? false; - } - try { if (data.clientFlags) { const clientFlags = JSON.parse(data.clientFlags);