hof 20.3.11 → 20.4.0-beta-session-timeout
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/.nyc_output/9651d42a-59d8-48e6-949c-655d9fa6db21.json +1 -0
- package/.nyc_output/processinfo/9651d42a-59d8-48e6-949c-655d9fa6db21.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/components/date/templates/date.html +1 -1
- package/config/hof-defaults.js +10 -5
- package/frontend/govuk-template/build/govuk_template.html +17 -18
- package/frontend/govuk-template/govuk_template_generated.html +17 -18
- package/frontend/template-mixins/partials/forms/checkbox-group.html +1 -1
- package/frontend/template-mixins/partials/forms/option-group.html +1 -1
- package/frontend/template-mixins/partials/forms/textarea-group.html +3 -1
- package/frontend/template-partials/translations/src/en/buttons.json +1 -0
- package/frontend/template-partials/views/layout.html +2 -1
- package/frontend/template-partials/views/partials/cookie-banner.html +2 -2
- package/frontend/template-partials/views/partials/gatag.html +0 -1
- package/frontend/template-partials/views/partials/head.html +23 -0
- package/frontend/template-partials/views/partials/session-timeout-warning.html +26 -0
- package/frontend/themes/gov-uk/client-js/dialog/index.js +358 -0
- package/frontend/themes/gov-uk/client-js/dialog/utils.js +114 -0
- package/frontend/themes/gov-uk/client-js/index.js +1 -0
- package/frontend/themes/gov-uk/styles/govuk.scss +1 -0
- package/frontend/themes/gov-uk/styles/session_timeout.scss +138 -0
- package/lib/ga-tag.js +33 -7
- package/lib/health.js +1 -1
- package/lib/sessions.js +0 -2
- package/middleware/cookies.js +2 -0
- package/middleware/rate-limiter.js +1 -3
- package/package.json +5 -5
- package/sandbox/apps/sandbox/fields.js +0 -6
- package/sandbox/apps/sandbox/translations/src/en/fields.json +5 -5
- package/sandbox/apps/sandbox/translations/src/en/pages.json +1 -1
- package/sandbox/config.js +1 -2
- package/sandbox/public/js/bundle.js +965 -1130
- package/sandbox/server.js +1 -4
- package/sandbox/yarn.lock +3 -3
- package/.nyc_output/b924df42-9cb6-4618-9a07-4f58f67ae28a.json +0 -1
- package/.nyc_output/processinfo/b924df42-9cb6-4618-9a07-4f58f67ae28a.json +0 -1
- package/sandbox/dump.rdb +0 -0
package/middleware/cookies.js
CHANGED
@@ -22,6 +22,8 @@ module.exports = options => {
|
|
22
22
|
const reqIsCookieCheckRedirect = req.query[paramName] !== undefined;
|
23
23
|
|
24
24
|
if (reqIncludesCookies || isHealthcheckUrl(req.path, healthcheckUrls)) {
|
25
|
+
const prefs = 'cookie_preferences' in req.cookies ? JSON.parse(req.cookies.cookie_preferences) : {};
|
26
|
+
res.locals.cookiesAccepted = Boolean(prefs.usage);
|
25
27
|
next();
|
26
28
|
} else if (req.cookies === undefined || (!Object.keys(req.cookies).length && reqIsCookieCheckRedirect)) {
|
27
29
|
const err = new Error('Cookies required');
|
@@ -25,11 +25,9 @@ module.exports = (options, rateLimitType) => {
|
|
25
25
|
}
|
26
26
|
|
27
27
|
const closeConnection = async err => {
|
28
|
-
await redisClient.
|
28
|
+
await redisClient.quit();
|
29
29
|
return next(err);
|
30
30
|
};
|
31
|
-
redisClient.on('error', err => logger.log('error', err));
|
32
|
-
await redisClient.connect();
|
33
31
|
|
34
32
|
try {
|
35
33
|
// fetch records of current user using IP address, returns null when no record is found
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hof",
|
3
3
|
"description": "A bootstrap for HOF projects",
|
4
|
-
"version": "20.
|
4
|
+
"version": "20.4.0-beta-session-timeout",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "index.js",
|
7
7
|
"author": "HomeOffice",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
"nodemailer-smtp-transport": "^2.7.4",
|
81
81
|
"nodemailer-stub-transport": "^1.1.0",
|
82
82
|
"notifications-node-client": "^6.0.0",
|
83
|
-
"redis": "^
|
83
|
+
"redis": "^3.1.2",
|
84
84
|
"reqres": "^3.0.1",
|
85
85
|
"request": "^2.79.0",
|
86
86
|
"rimraf": "^3.0.2",
|
@@ -96,6 +96,7 @@
|
|
96
96
|
"@cucumber/cucumber": "^7.3.0",
|
97
97
|
"@cucumber/pretty-formatter": "^1.0.0-alpha.1",
|
98
98
|
"@types/jest": "^26.0.14",
|
99
|
+
"@xmldom/xmldom": "~0.8.4",
|
99
100
|
"chai": "^3.5.0",
|
100
101
|
"chai-as-promised": "^7.1.1",
|
101
102
|
"chai-subset": "^1.6.0",
|
@@ -122,14 +123,13 @@
|
|
122
123
|
"playwright": "^1.16.3",
|
123
124
|
"postcode": "0.2.2",
|
124
125
|
"proxyquire": "^1.7.11",
|
125
|
-
"release-it": "^
|
126
|
+
"release-it": "^16.2.1",
|
126
127
|
"sinon": "^11.1.1",
|
127
128
|
"sinon-chai": "^3.7.0",
|
128
129
|
"supertest": "^3.0.0",
|
129
130
|
"travis-conditions": "0.0.0",
|
130
131
|
"watchify": "^4.0.0",
|
131
|
-
"webdriverio": "^4.14.4"
|
132
|
-
"xmldom": "^0.6.0"
|
132
|
+
"webdriverio": "^4.14.4"
|
133
133
|
},
|
134
134
|
"mocha": {
|
135
135
|
"reporter": "spec",
|
@@ -16,9 +16,6 @@ module.exports = {
|
|
16
16
|
},
|
17
17
|
name: {
|
18
18
|
validate: ['required', 'notUrl', { type: 'maxlength', arguments: 200 }],
|
19
|
-
// need to remove this for the heading to go
|
20
|
-
labelClassName: ['govuk-label--l'],
|
21
|
-
isPageHeading: 'true'
|
22
19
|
},
|
23
20
|
'dateOfBirth': dateComponent('dateOfBirth', {
|
24
21
|
mixin: 'input-date',
|
@@ -70,8 +67,6 @@ module.exports = {
|
|
70
67
|
]
|
71
68
|
},
|
72
69
|
email: {
|
73
|
-
isPageHeading: 'true',
|
74
|
-
labelClassName: ['govuk-label--l'],
|
75
70
|
validate: ['required', 'email']
|
76
71
|
},
|
77
72
|
phone: {
|
@@ -114,7 +109,6 @@ module.exports = {
|
|
114
109
|
// apply the other default formatters
|
115
110
|
formatter: ['trim', 'hyphens'],
|
116
111
|
isPageHeading: 'true',
|
117
|
-
labelClassName: ['govuk-label--l'],
|
118
112
|
// attributes here are passed to the field element
|
119
113
|
validate: ['required', { type: 'maxword', arguments: 10 }],
|
120
114
|
attributes: [{
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"label": "Full name"
|
19
19
|
},
|
20
20
|
"dateOfBirth": {
|
21
|
-
"legend": "
|
21
|
+
"legend": "What is your date of birth?",
|
22
22
|
"hint": "For example, 31 10 1990"
|
23
23
|
},
|
24
24
|
"building": {
|
@@ -29,8 +29,8 @@
|
|
29
29
|
},
|
30
30
|
"townOrCity": {
|
31
31
|
"label": "Town or city"
|
32
|
-
},
|
33
|
-
"postcode": {
|
32
|
+
},
|
33
|
+
"postcode": {
|
34
34
|
"label": "Postcode"
|
35
35
|
},
|
36
36
|
"incomeTypes" : {
|
@@ -66,8 +66,8 @@
|
|
66
66
|
},
|
67
67
|
"northernIreland": {
|
68
68
|
"label": "Northern Ireland"
|
69
|
-
}
|
70
|
-
}
|
69
|
+
}
|
70
|
+
}
|
71
71
|
},
|
72
72
|
"email" : {
|
73
73
|
"label": "Email address"
|
@@ -50,7 +50,7 @@
|
|
50
50
|
},
|
51
51
|
"confirmation": {
|
52
52
|
"title": "Application sent",
|
53
|
-
"alert": "Application sent",
|
53
|
+
"alert": "Application sent",
|
54
54
|
"subheader": "What happens next",
|
55
55
|
"content": "We’ll contact you with the decision of your application or if we need more information from you."
|
56
56
|
}
|
package/sandbox/config.js
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
/* eslint no-process-env: 0 */
|
4
4
|
module.exports = {
|
5
|
-
port: 8082,
|
6
5
|
email: {
|
7
6
|
caseworker: process.env.CASEWORKER_EMAIL || '',
|
8
7
|
from: process.env.FROM_ADDRESS || '',
|
@@ -13,6 +12,6 @@ module.exports = {
|
|
13
12
|
region: process.env.EMAIL_REGION || ''
|
14
13
|
},
|
15
14
|
hosts: {
|
16
|
-
acceptanceTests: process.env.ACCEPTANCE_HOST_NAME || `http://localhost:${process.env.PORT ||
|
15
|
+
acceptanceTests: process.env.ACCEPTANCE_HOST_NAME || `http://localhost:${process.env.PORT || 8080}`
|
17
16
|
}
|
18
17
|
};
|