propro-utils 1.5.59 → 1.5.62
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/middlewares/account_info.js +1 -1
- package/package.json +1 -1
- package/src/index.js +6 -0
|
@@ -105,7 +105,7 @@ const checkIfUserExists = async accountId => {
|
|
|
105
105
|
const userSchema = await ServiceManager.getService('UserSchema');
|
|
106
106
|
const userStyleSchema = await ServiceManager.getService('UserStyleSchema');
|
|
107
107
|
const folderSchema = await ServiceManager.getService('FolderSchema');
|
|
108
|
-
const Theme =
|
|
108
|
+
const Theme = await ServiceManager.getService('Theme');
|
|
109
109
|
|
|
110
110
|
let user = await userSchema
|
|
111
111
|
.findOne({ accountId })
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -31,6 +31,8 @@ let _serverAuth, _clientAuth;
|
|
|
31
31
|
* @param {Object} [options.clientOptions={}] - Configuration options for client-side authentication.
|
|
32
32
|
* @param {Schema} [userSchema] - The user schema to perform the operations on.
|
|
33
33
|
* @param {Schema} [userStyleSchema] - The user style schema to perform the operations on.
|
|
34
|
+
* @param {Schema} [folderSchema] - The folder schema to perform the operations on.
|
|
35
|
+
* @param {Schema} [themeSchema] - The theme schema to perform the operations on.
|
|
34
36
|
* @param {RedisClient} [redisClient] - The Redis client used for caching.
|
|
35
37
|
*
|
|
36
38
|
* @returns {Function} An Express middleware function.
|
|
@@ -55,12 +57,14 @@ class ProProAuthMiddleware {
|
|
|
55
57
|
userSchema,
|
|
56
58
|
userStyleSchema,
|
|
57
59
|
folderSchema,
|
|
60
|
+
themeSchema,
|
|
58
61
|
redisClient
|
|
59
62
|
) {
|
|
60
63
|
this.options = options;
|
|
61
64
|
this.userSchema = userSchema;
|
|
62
65
|
this.userStyleSchema = userStyleSchema;
|
|
63
66
|
this.folderSchema = folderSchema;
|
|
67
|
+
this.themeSchema = themeSchema;
|
|
64
68
|
this.redisClient = redisClient;
|
|
65
69
|
this.serverAuth = null;
|
|
66
70
|
this.clientAuth = null;
|
|
@@ -92,6 +96,7 @@ class ProProAuthMiddleware {
|
|
|
92
96
|
this.userSchema,
|
|
93
97
|
this.userStyleSchema,
|
|
94
98
|
this.folderSchema,
|
|
99
|
+
this.themeSchema,
|
|
95
100
|
this.redisClient
|
|
96
101
|
);
|
|
97
102
|
}
|
|
@@ -100,6 +105,7 @@ class ProProAuthMiddleware {
|
|
|
100
105
|
ServiceManager.registerService('UserStyleSchema', this.userStyleSchema);
|
|
101
106
|
ServiceManager.registerService('RedisClient', this.redisClient);
|
|
102
107
|
ServiceManager.registerService('FolderSchema', this.folderSchema);
|
|
108
|
+
ServiceManager.registerService('ThemeSchema', this.themeSchema);
|
|
103
109
|
return this.serverAuth.middleware();
|
|
104
110
|
}
|
|
105
111
|
|