aboutsummaryrefslogtreecommitdiffstats
path: root/routes/users.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/users.js')
-rw-r--r--routes/users.js8
1 files changed, 8 insertions, 0 deletions
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,