2024-03-05 10:20:36 +00:00

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")
}
}