Skip to content

Commit

Permalink
BC-7124 - Remove etherpad sessions on logout (#3450)
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax authored May 21, 2024
1 parent 38fa3d0 commit 0363c8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,13 @@ router.get('/logout/', (req, res, next) => {
.catch((err) => {
logger.error('error during logout.', formatError(err));
});

api(req, { version: 'v3' })
.del('/collaborative-text-editor/delete-sessions') // async, ignore result
.catch((err) => {
logger.error('can not delete etherpad client sessions', formatError(err));
});

return authHelper.clearCookie(req, res, sessionDestroyer)
// eslint-disable-next-line prefer-template, no-return-assign
.then(() => {
Expand Down
1 change: 1 addition & 0 deletions helpers/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const clearCookie = async (req, res, options = { destroySession: false }) => {
});
});
}

res.clearCookie('jwt');
// this is deprecated and only used for cookie removal from now on,
// and can be removed after one month (max cookie lifetime from life systems)
Expand Down

0 comments on commit 0363c8e

Please sign in to comment.