hof 22.9.0-fix-timeout-back-button-bug-beta.2 → 22.9.0-fix-timeout-back-button-bug-beta.3
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.
@@ -1,10 +1,7 @@
|
|
1
1
|
{{<error}}
|
2
|
-
{{$header}}
|
3
|
-
{{#t}}errors.session.title{{/t}}
|
4
|
-
{{/header}}
|
5
2
|
{{$content}}
|
6
|
-
<h1 class="govuk-heading-l">{{
|
7
|
-
<h2 class="govuk-heading-m">{{
|
3
|
+
<h1 class="govuk-heading-l">{{{content.title}}}</h1>
|
4
|
+
<h2 class="govuk-heading-m">{{{content.message}}}</h2>
|
8
5
|
<a href="{{startLink}}" class="govuk-button" role="button">{{#t}}buttons.start-again{{/t}}</a>
|
9
6
|
{{/content}}
|
10
7
|
{{/error}}
|
package/index.js
CHANGED
@@ -249,6 +249,22 @@ function bootstrap(options) {
|
|
249
249
|
return next();
|
250
250
|
});
|
251
251
|
}
|
252
|
+
|
253
|
+
app.get('/session-timeout', (req, res, next) => {
|
254
|
+
const referer = req.get('referer');
|
255
|
+
console.log(referer);
|
256
|
+
console.log(req.session.exists);
|
257
|
+
if (req.cookies['hof-wizard-sc'] && req.session.exists !== true) {
|
258
|
+
const err = new Error('Session expired');
|
259
|
+
err.code = 'SESSION_TIMEOUT';
|
260
|
+
return next(err);
|
261
|
+
}
|
262
|
+
const err = new Error('Not Found');
|
263
|
+
err.status = 404;
|
264
|
+
const locals = Object.assign({}, req.translate('errors'));
|
265
|
+
return res.status(404).render('404', locals['404']);
|
266
|
+
});
|
267
|
+
|
252
268
|
if (config.getAccessibility === true) {
|
253
269
|
deprecate(
|
254
270
|
'`getAccessibility` option is deprecated and may be removed in future versions.',
|
package/package.json
CHANGED
package/sandbox/.env
CHANGED