@gov-cy/govcy-express-services 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gov-cy/govcy-express-services",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "An Express-based system that dynamically renders services using @gov-cy/govcy-frontend-renderer and posts data to a submission API.",
|
|
5
5
|
"author": "DMRID - DSF Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { govcyFrontendRenderer } from '@gov-cy/govcy-frontend-renderer';
|
|
2
2
|
import * as govcyResources from "../resources/govcyResources.mjs";
|
|
3
3
|
import * as dataLayer from "../utils/govcyDataLayer.mjs";
|
|
4
|
+
import {logger} from "../utils/govcyLogger.mjs";
|
|
4
5
|
import {listAvailableSiteConfigs, getServiceConfigData} from "../utils/govcyLoadConfigData.mjs";
|
|
5
6
|
import { whatsIsMyEnvironment } from '../utils/govcyEnvVariables.mjs';
|
|
6
7
|
|
|
@@ -13,7 +14,13 @@ export function govcyRoutePageHandler(req, res, next) {
|
|
|
13
14
|
// if current service cookie is set redirect to that page
|
|
14
15
|
if (req.cookies.cs) {
|
|
15
16
|
const siteId = req.cookies.cs;
|
|
16
|
-
|
|
17
|
+
let serviceData = {};
|
|
18
|
+
try {
|
|
19
|
+
serviceData = getServiceConfigData(siteId, req.globalLang) || {};
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
logger.debug('Could not read data from cookie:', e.message);
|
|
23
|
+
}
|
|
17
24
|
if (serviceData.site && serviceData.site.homeRedirectPage) {
|
|
18
25
|
const homeRedirectPage = serviceData.site.homeRedirectPage;
|
|
19
26
|
const lang = req.globalLang || 'el'; // fallback to 'en' if not set
|