propro-utils 1.5.89 → 1.5.91
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.
|
@@ -128,19 +128,47 @@ const checkIfUserExists = async accountId => {
|
|
|
128
128
|
try {
|
|
129
129
|
console.log('Loading schemas...');
|
|
130
130
|
// Load all required schemas in parallel
|
|
131
|
+
const schemaResults = await Promise.all([
|
|
132
|
+
ServiceManager.getService('UserSchema'),
|
|
133
|
+
ServiceManager.getService('UserStyleSchema'),
|
|
134
|
+
ServiceManager.getService('FolderSchema'),
|
|
135
|
+
ServiceManager.getService('ThemeSchema'),
|
|
136
|
+
]);
|
|
137
|
+
|
|
131
138
|
const [userSchema, userStyleSchema, folderSchema, themeSchema] =
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
schemaResults;
|
|
140
|
+
|
|
141
|
+
// Log the status of each schema
|
|
142
|
+
console.log('Schema loading results:', {
|
|
143
|
+
userSchema: userSchema ? 'Loaded' : 'Not available',
|
|
144
|
+
userStyleSchema: userStyleSchema ? 'Loaded' : 'Not available',
|
|
145
|
+
folderSchema: folderSchema ? 'Loaded' : 'Not available',
|
|
146
|
+
themeSchema: themeSchema ? 'Loaded' : 'Not available',
|
|
147
|
+
});
|
|
139
148
|
|
|
140
149
|
if (!userSchema) {
|
|
141
150
|
throw new Error('UserSchema service not available');
|
|
142
151
|
}
|
|
143
152
|
|
|
153
|
+
// Optional schemas warning
|
|
154
|
+
if (!userStyleSchema) {
|
|
155
|
+
console.warn(
|
|
156
|
+
'UserStyleSchema service not available - style features will be skipped'
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
if (!folderSchema) {
|
|
160
|
+
console.warn(
|
|
161
|
+
'FolderSchema service not available - folder features will be skipped'
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
if (!themeSchema) {
|
|
165
|
+
console.warn(
|
|
166
|
+
'ThemeSchema service not available - theme features will be skipped'
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
console.log('Schema loading and validation complete');
|
|
171
|
+
|
|
144
172
|
// Find existing user with populated fields
|
|
145
173
|
const user = await userSchema
|
|
146
174
|
.findOne({ accountId })
|
package/package.json
CHANGED
|
@@ -108,6 +108,9 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
|
|
|
108
108
|
if (domain?.includes('localhost')) {
|
|
109
109
|
domain = undefined;
|
|
110
110
|
}
|
|
111
|
+
if (domain?.includes('propro.so')) {
|
|
112
|
+
domain = 'propro.so';
|
|
113
|
+
}
|
|
111
114
|
} catch (error) {
|
|
112
115
|
console.error('Invalid appUrl:', { error, appUrl });
|
|
113
116
|
domain = undefined;
|