@hmcts/opal-frontend-common-node 0.0.7 → 0.0.8
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/csrf-token/index.d.ts.map +1 -1
- package/csrf-token/index.js +3 -4
- package/csrf-token/index.js.map +1 -1
- package/package.json +5 -5
- package/type.d.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/csrf-token/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/csrf-token/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,qBAAa,SAAS;IACb,SAAS,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;CA8BjH"}
|
package/csrf-token/index.js
CHANGED
|
@@ -10,9 +10,8 @@ export class CSRFToken {
|
|
|
10
10
|
secure: secure,
|
|
11
11
|
path: '/',
|
|
12
12
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
13
|
+
getSessionIdentifier: (req) => req.session.id,
|
|
14
|
+
getCsrfTokenFromRequest: (req) => req.cookies[cookieName].split('|')[0] ?? null,
|
|
16
15
|
});
|
|
17
16
|
app.use((req, res, next) => {
|
|
18
17
|
if (ignore.includes(req.url)) {
|
|
@@ -24,7 +23,7 @@ export class CSRFToken {
|
|
|
24
23
|
});
|
|
25
24
|
app.use((req, res, next) => {
|
|
26
25
|
if (req.csrfToken) {
|
|
27
|
-
req.csrfToken(true);
|
|
26
|
+
req.csrfToken({ overwrite: true, validateOnReuse: true });
|
|
28
27
|
}
|
|
29
28
|
next();
|
|
30
29
|
});
|
package/csrf-token/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/csrf-token/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,MAAM,OAAO,SAAS;IACb,SAAS,CAAC,GAAgB,EAAE,MAAc,EAAE,UAAkB,EAAE,QAAiB,EAAE,MAAe;QACvG,MAAM,MAAM,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAEvC,MAAM,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC;YAC1C,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;YACvB,UAAU,EAAE,UAAU;YACtB,aAAa,EAAE;gBACb,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,GAAG;aACV;YACD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/csrf-token/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,MAAM,OAAO,SAAS;IACb,SAAS,CAAC,GAAgB,EAAE,MAAc,EAAE,UAAkB,EAAE,QAAiB,EAAE,MAAe;QACvG,MAAM,MAAM,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAEvC,MAAM,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC;YAC1C,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;YACvB,UAAU,EAAE,UAAU;YACtB,aAAa,EAAE;gBACb,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,GAAG;aACV;YACD,oBAAoB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAC7C,uBAAuB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI;SAChF,CAAC,CAAC;QAEH,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC7B,IAAI,EAAE,CAAC;YACT,CAAC;iBAAM,CAAC;gBACN,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YACvC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;gBAClB,GAAG,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5D,CAAC;YACD,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmcts/opal-frontend-common-node",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Common nodejs library components for opal",
|
|
7
7
|
"main": "dist/index",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"config": "^3.3.9",
|
|
25
25
|
"connect-redis": "^8.0.0",
|
|
26
26
|
"cookie-parser": "^1.4.6",
|
|
27
|
-
"csrf-csrf": "^
|
|
27
|
+
"csrf-csrf": "^4.0.0",
|
|
28
28
|
"express": "^5.0.0",
|
|
29
29
|
"express-session": "^1.17.3",
|
|
30
30
|
"helmet": "^8.0.0",
|
|
31
31
|
"http-proxy-middleware": "^3.0.0",
|
|
32
32
|
"luxon": "^3.4.3",
|
|
33
33
|
"prettier": "^3.0.3",
|
|
34
|
-
"redis": "^
|
|
34
|
+
"redis": "^5.0.0",
|
|
35
35
|
"session-file-store": "^1.5.0",
|
|
36
36
|
"xml2js": "^0.6.2"
|
|
37
37
|
},
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@types/luxon": "^3.4.2",
|
|
43
43
|
"@types/node": "^22.0.0",
|
|
44
44
|
"@types/session-file-store": "^1.2.5",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
46
|
-
"@typescript-eslint/parser": "8.
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "8.32.0",
|
|
46
|
+
"@typescript-eslint/parser": "8.32.0",
|
|
47
47
|
"eslint": "^9.0.0",
|
|
48
48
|
"eslint-plugin-prettier": "^5.2.6",
|
|
49
49
|
"typescript": "~5.8.0",
|