From 3bbc627473edd61214498aaaf1872b9a16c5ea48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Sun, 4 Mar 2018 14:09:12 +0100 Subject: [PATCH] Fixed API token-timeout fix --- server/routing/client/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routing/client/api.js b/server/routing/client/api.js index d69bda45..60479c63 100644 --- a/server/routing/client/api.js +++ b/server/routing/client/api.js @@ -776,12 +776,12 @@ function checkOveruseApiToken(authorized, token_docs, res, callback) { res.status(429).send(JSON.stringify(error.tooMany)); return; } else { - db.collection("timeout_api").update({guid: token}, {$inc: {used: 1}}, function(e, d) { + db.collection("timeout_api").update({guid: token_docs[0].token}, {$inc: {used: 1}}, function(e, d) { callback(); }); } } else { - db.collection("timeout_api").insert({guid: token, used: 0, createdAt: new Date(), type: "ALL"}, function(e, d) { + db.collection("timeout_api").insert({guid: token_docs[0].token, used: 0, createdAt: new Date(), type: "ALL"}, function(e, d) { callback(); }); }