aboutsummaryrefslogtreecommitdiffstats
path: root/routes/users.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-06-25 20:29:14 -0700
committerAdam Soltys <[email protected]>2020-06-25 20:29:30 -0700
commit96dff083b35748e65d728c4958d5426e8e13f6c8 (patch)
treecf4fcfdaa4c2a10678812cc3ddff41b0927e8616 /routes/users.js
parent661eafded5cffe1cc74a907e6cfe629895e35b98 (diff)
downloadcoinos-server-96dff083b35748e65d728c4958d5426e8e13f6c8.tar.gz
coinos-server-96dff083b35748e65d728c4958d5426e8e13f6c8.zip
authorize additional linking keys
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,