propro-utils 1.7.56 → 1.7.57
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 +9 -0
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -68,6 +68,7 @@ class AuthMiddleware {
|
|
|
68
68
|
this.router.get('/api/callback', this.handleCallback);
|
|
69
69
|
this.router.post('/api/refreshToken', this.handleRefreshToken);
|
|
70
70
|
this.router.post('/api/logout', this.handleLogout);
|
|
71
|
+
this.router.post('/api/auth/session/clear', this.handleClearAuthSession);
|
|
71
72
|
this.router.patch('/api/profile', this.handleProfileUpdate);
|
|
72
73
|
this.router.patch('/api/profile/password', this.handlePasswordUpdate);
|
|
73
74
|
this.router.patch('/api/profile/email', this.handleEmailUpdate);
|
|
@@ -341,6 +342,14 @@ class AuthMiddleware {
|
|
|
341
342
|
}
|
|
342
343
|
};
|
|
343
344
|
|
|
345
|
+
handleClearAuthSession = async (_req, res) => {
|
|
346
|
+
// appUrl is required: without it the deletions go out host-only and do
|
|
347
|
+
// not match the cookies setAuthCookies wrote on `.mapmap.app`, so the
|
|
348
|
+
// session survives the redirect to login.
|
|
349
|
+
await clearAuthCookies(res, this.options.appUrl);
|
|
350
|
+
res.status(204).end();
|
|
351
|
+
};
|
|
352
|
+
|
|
344
353
|
refreshTokens = async refreshToken => {
|
|
345
354
|
const formattedAuthUrl = formatRedirectUrl(this.options.authUrl);
|
|
346
355
|
return axios.post(
|