From 96dff083b35748e65d728c4958d5426e8e13f6c8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 25 Jun 2020 20:29:14 -0700 Subject: authorize additional linking keys --- routes/users.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'routes/users.js') diff --git a/routes/users.js b/routes/users.js index 522d2e6a..5a708d00 100644 --- a/routes/users.js +++ b/routes/users.js @@ -262,6 +262,14 @@ app.post("/keys", auth, async (req, res) => { emit(req.user.username, "key", key); }); +app.post("/keys/delete", auth, async (req, res) => { + const { hex } = req.body; + (await db.Key.findOne({ where: { + user_id: req.user.id, + hex + }})).destroy(); +}); + app.post("/login", async (req, res) => { const { params, -- cgit v1.2.3