mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
16 lines
375 B
JavaScript
Executable File
16 lines
375 B
JavaScript
Executable File
export default {
|
|
method: "DELETE",
|
|
route: "/all",
|
|
middlewares: ["withAuthentication"],
|
|
fn: async (req, res) => {
|
|
const user_id = req.user._id.toString()
|
|
|
|
const allSessions = await Session.deleteMany({ user_id })
|
|
|
|
if (allSessions) {
|
|
return res.json("done")
|
|
}
|
|
|
|
return res.status(404).json("not found")
|
|
}
|
|
} |