2025-05-10 02:09:06 +02:00
|
|
|
/*!
|
|
|
|
* Copyright (c) 2024 PLANKA Software GmbH
|
|
|
|
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
|
|
|
*/
|
|
|
|
|
2022-09-07 18:39:33 +05:00
|
|
|
module.exports = {
|
|
|
|
async fn() {
|
2024-09-01 09:31:04 +02:00
|
|
|
const { currentSession } = this.req;
|
2022-09-07 18:39:33 +05:00
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
await Session.qm.deleteOneById(currentSession.id);
|
2022-09-07 18:39:33 +05:00
|
|
|
|
2024-09-01 09:31:04 +02:00
|
|
|
sails.sockets.leaveAll(`@accessToken:${currentSession.accessToken}`);
|
|
|
|
|
|
|
|
if (currentSession.httpOnlyToken && !this.req.isSocket) {
|
|
|
|
sails.helpers.utils.clearHttpOnlyTokenCookie(this.res);
|
2024-04-09 15:12:46 +02:00
|
|
|
}
|
|
|
|
|
2022-09-07 18:39:33 +05:00
|
|
|
return {
|
2024-09-01 09:31:04 +02:00
|
|
|
item: currentSession.accessToken,
|
2022-09-07 18:39:33 +05:00
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|