propro-utils 1.4.92 → 1.4.94
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 +1 -1
- package/src/server/index.js +6 -2
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -57,7 +57,7 @@ class AuthMiddleware {
|
|
|
57
57
|
this.router.patch('/api/profile/password', this.handlePasswordUpdate);
|
|
58
58
|
this.router.patch('/api/profile/email', this.handleEmailUpdate);
|
|
59
59
|
this.router.patch('api/profile/2fa', this.handleTwoFactorAuth);
|
|
60
|
-
this.router.
|
|
60
|
+
this.router.post('/api/profile/avatar', this.handleAvatarUpdate);
|
|
61
61
|
this.router.patch(
|
|
62
62
|
'/api/app/settings',
|
|
63
63
|
authValidation(this.redisClient, this.userSchema, ['user']),
|
|
@@ -207,7 +207,8 @@ class AuthMiddleware {
|
|
|
207
207
|
};
|
|
208
208
|
|
|
209
209
|
handleLogout = async (req, res) => {
|
|
210
|
-
const refreshToken =
|
|
210
|
+
const refreshToken =
|
|
211
|
+
req.cookies['x-refresh-token'] || req.headers['x-refresh-token'];
|
|
211
212
|
if (!refreshToken) {
|
|
212
213
|
return res.status(401).json({ error: 'No refresh token provided' });
|
|
213
214
|
}
|
|
@@ -333,6 +334,9 @@ class AuthMiddleware {
|
|
|
333
334
|
}
|
|
334
335
|
|
|
335
336
|
const formattedAuthUrl = formatRedirectUrl(this.options.authUrl);
|
|
337
|
+
|
|
338
|
+
console.log('formattedAuthUrl:', formattedAuthUrl);
|
|
339
|
+
console.log('req.method:', req.method);
|
|
336
340
|
return axios({
|
|
337
341
|
method: req.method,
|
|
338
342
|
url: `${formattedAuthUrl}${path}&clientId=${this.options.clientId}&redirectUri=${this.options.redirectUri}`,
|