@opengis/fastify-table 1.0.24 → 1.0.25
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/Changelog.md +4 -0
- package/index.js +4 -1
- package/package.json +1 -1
- package/test/api/crud.xss.test.js +4 -1
package/Changelog.md
CHANGED
package/index.js
CHANGED
|
@@ -22,7 +22,10 @@ async function plugin(fastify, opt) {
|
|
|
22
22
|
fastify.decorate('config', config);
|
|
23
23
|
}
|
|
24
24
|
if (!fastify.funcs) {
|
|
25
|
-
fastify.
|
|
25
|
+
fastify.addHook('onRequest', async (req) => {
|
|
26
|
+
req.funcs = fastify;
|
|
27
|
+
});
|
|
28
|
+
// fastify.decorateRequest('funcs', fastify);
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
policyPlugin(fastify);
|
package/package.json
CHANGED
|
@@ -9,7 +9,10 @@ import config from '../config.js';
|
|
|
9
9
|
test('api crud xss', async (t) => {
|
|
10
10
|
const app = await build(t);
|
|
11
11
|
const session = { passport: { user: { uid: '1' } } };
|
|
12
|
-
app.
|
|
12
|
+
app.addHook('onRequest', async (req) => {
|
|
13
|
+
req.session = session;
|
|
14
|
+
});
|
|
15
|
+
// app.decorateRequest('session', session);
|
|
13
16
|
|
|
14
17
|
const prefix = config.prefix || '/api';
|
|
15
18
|
|