mirror of
https://github.com/plankanban/planka.git
synced 2025-12-17 09:13:23 +03:00
feat: Invalidate access token on logout
This commit is contained in:
16
server/api/controllers/access-tokens/delete.js
Normal file
16
server/api/controllers/access-tokens/delete.js
Normal file
@@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
async fn() {
|
||||
const { accessToken } = this.req;
|
||||
|
||||
await Session.updateOne({
|
||||
accessToken,
|
||||
deletedAt: null,
|
||||
}).set({
|
||||
deletedAt: new Date().toUTCString(),
|
||||
});
|
||||
|
||||
return {
|
||||
item: accessToken,
|
||||
};
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user