@lenne.tech/nest-server 11.6.0 → 11.6.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "11.6.
|
|
3
|
+
"version": "11.6.1",
|
|
4
4
|
"description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -31,12 +31,13 @@ export class CheckSecurityInterceptor implements NestInterceptor {
|
|
|
31
31
|
// Get current user
|
|
32
32
|
const user = getContextData(context)?.currentUser || null;
|
|
33
33
|
|
|
34
|
-
// Set force mode for sign in and sign up
|
|
34
|
+
// Set force mode for sign in and sign up (both GraphQL and REST)
|
|
35
35
|
let force = false;
|
|
36
36
|
if (!user) {
|
|
37
37
|
// Here the name is used and not the class itself, because the concrete class is located in the respective project.
|
|
38
|
-
// In case of an override it is better to use the concrete class directly (context.getClass() instead of context.
|
|
39
|
-
|
|
38
|
+
// In case of an override it is better to use the concrete class directly (context.getClass() instead of context.getClass()?.name).
|
|
39
|
+
const className = context.getClass()?.name;
|
|
40
|
+
if (className === 'AuthResolver' || className === 'AuthController') {
|
|
40
41
|
force = true;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -76,7 +77,7 @@ export class CheckSecurityInterceptor implements NestInterceptor {
|
|
|
76
77
|
|
|
77
78
|
// Check if data is writeable (e.g. objects from direct access to json files via http are not writable)
|
|
78
79
|
if (data && typeof data === 'object') {
|
|
79
|
-
const writeable = !Object.keys(data).find(key => !Object.getOwnPropertyDescriptor(data, key).writable);
|
|
80
|
+
const writeable = !Object.keys(data).find((key) => !Object.getOwnPropertyDescriptor(data, key).writable);
|
|
80
81
|
if (!writeable) {
|
|
81
82
|
return data;
|
|
82
83
|
}
|
|
@@ -88,7 +89,7 @@ export class CheckSecurityInterceptor implements NestInterceptor {
|
|
|
88
89
|
(item) => {
|
|
89
90
|
if (!item || typeof item !== 'object' || typeof item.securityCheck !== 'function') {
|
|
90
91
|
if (Array.isArray(item)) {
|
|
91
|
-
return item.filter(i => i !== undefined);
|
|
92
|
+
return item.filter((i) => i !== undefined);
|
|
92
93
|
}
|
|
93
94
|
return item;
|
|
94
95
|
}
|