propro-utils 1.5.68 → 1.5.70
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.
|
@@ -113,7 +113,9 @@ const checkIfUserExists = async accountId => {
|
|
|
113
113
|
const userSchema = await ServiceManager.getService('UserSchema');
|
|
114
114
|
const userStyleSchema = await ServiceManager.getService('UserStyleSchema');
|
|
115
115
|
const folderSchema = await ServiceManager.getService('FolderSchema');
|
|
116
|
+
const themeSchema = await ServiceManager.getService('ThemeSchema');
|
|
116
117
|
|
|
118
|
+
console.log('themeschema', themeSchema);
|
|
117
119
|
let user = await userSchema
|
|
118
120
|
.findOne({ accountId })
|
|
119
121
|
.populate('userGlobalStyles');
|
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -33,7 +33,13 @@ const upload = multer().single('file');
|
|
|
33
33
|
* @returns {Function} - Express middleware function.
|
|
34
34
|
*/
|
|
35
35
|
class AuthMiddleware {
|
|
36
|
-
constructor(
|
|
36
|
+
constructor(
|
|
37
|
+
options = {},
|
|
38
|
+
userSchema,
|
|
39
|
+
userStyleSchema,
|
|
40
|
+
themeSchema,
|
|
41
|
+
redisClient
|
|
42
|
+
) {
|
|
37
43
|
this.options = {
|
|
38
44
|
secret: options.secret || 'RESTFULAPIs',
|
|
39
45
|
authUrl: options.authUrl || process.env.AUTH_URL,
|
|
@@ -47,6 +53,7 @@ class AuthMiddleware {
|
|
|
47
53
|
this.userSchema = userSchema;
|
|
48
54
|
this.redisClient = redisClient;
|
|
49
55
|
this.userStyleSchema = userStyleSchema;
|
|
56
|
+
this.themeSchema = themeSchema;
|
|
50
57
|
this.router = Router();
|
|
51
58
|
this.initializeRoutes();
|
|
52
59
|
}
|