propro-utils 1.5.37 → 1.5.39
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.
|
@@ -97,9 +97,6 @@ const checkIfUserExists = async accountId => {
|
|
|
97
97
|
accountId
|
|
98
98
|
);
|
|
99
99
|
await user.save();
|
|
100
|
-
user = await userSchema
|
|
101
|
-
.findOne({ accountId })
|
|
102
|
-
.populate('userGlobalStyles');
|
|
103
100
|
}
|
|
104
101
|
return user;
|
|
105
102
|
}
|
|
@@ -109,14 +106,12 @@ const checkIfUserExists = async accountId => {
|
|
|
109
106
|
accountId
|
|
110
107
|
);
|
|
111
108
|
|
|
112
|
-
|
|
109
|
+
return await userSchema.create({
|
|
113
110
|
accountId,
|
|
114
111
|
id: uuidv4(),
|
|
115
112
|
verified: false,
|
|
116
113
|
userGlobalStyles: userGlobalStyles._id,
|
|
117
114
|
});
|
|
118
|
-
|
|
119
|
-
return await user.populate('userGlobalStyles');
|
|
120
115
|
} catch (error) {
|
|
121
116
|
console.error('Error in checkIfUserExists:', error);
|
|
122
117
|
throw new Error('Failed to get or create user');
|
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -369,7 +369,8 @@ class AuthMiddleware {
|
|
|
369
369
|
headers.Authorization = `Bearer ${accessToken}`;
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
-
let formattedAuthUrl = formatRedirectUrl(this.options.authUrl) + path;
|
|
372
|
+
// let formattedAuthUrl = formatRedirectUrl(this.options.authUrl) + path;
|
|
373
|
+
let formattedAuthUrl = formatRedirectUrl('localhost:8182') + path;
|
|
373
374
|
|
|
374
375
|
if (!accessToken) {
|
|
375
376
|
formattedAuthUrl = `${formattedAuthUrl}?clientId=${this.options.clientId}&redirectUri=${this.options.redirectUri}`;
|