@opengis/fastify-table 2.0.12 → 2.0.13
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.
|
@@ -65,6 +65,7 @@ function plugin(fastify) {
|
|
|
65
65
|
};
|
|
66
66
|
req.user = req.session.passport.user;
|
|
67
67
|
}
|
|
68
|
+
// ! intentional: null || undefined > undefined
|
|
68
69
|
req.user = req.user || req.session?.passport?.user || undefined; // fix for user.uid errors, by default user is null, while with express passport it was {}, unauthorized user does not trigger serializer
|
|
69
70
|
if (config.trace && false) {
|
|
70
71
|
console.log("req.user?.uid", req.user?.uid, "req.session?.passport?.user?.uid", req.session?.passport?.user?.uid, "config.auth", config.auth);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export default async function getTemplateDir(type) {
|
|
2
|
+
import getTemplatePath from "./getTemplatePath.js";
|
|
3
|
+
import loadTemplate from "./loadTemplate.js";
|
|
4
|
+
export default function getTemplateDir(type) {
|
|
6
5
|
if (!type)
|
|
7
6
|
return null;
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
const arr = Array.isArray(type)
|
|
8
|
+
? type.map((el) => getTemplatePath(el)).flat()
|
|
9
|
+
: getTemplatePath(type);
|
|
10
10
|
if (!loadTemplate[type]) {
|
|
11
|
-
|
|
12
|
-
loadTemplate[type] = typeList;
|
|
11
|
+
loadTemplate[type] = arr.filter((el) => fs.existsSync(el[1]));
|
|
13
12
|
}
|
|
14
13
|
return loadTemplate[type];
|
|
15
14
|
}
|