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
|
|
|
|
|
|
|
await Session.updateOne({
|
2024-09-01 09:31:04 +02:00
|
|
|
id: currentSession.id,
|
2022-09-07 18:39:33 +05:00
|
|
|
deletedAt: null,
|
|
|
|
}).set({
|
2023-06-12 23:54:57 +02:00
|
|
|
deletedAt: new Date().toISOString(),
|
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
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|