diff --git a/api/functions/login/login.js b/api/functions/login/login.js index 698c0bb..e5b4b0c 100644 --- a/api/functions/login/login.js +++ b/api/functions/login/login.js @@ -37,19 +37,19 @@ const loginHandler = async (req, res) => { if (existingKeys.length >= 3) return res.status(400).json({ status: 'ERROR', reason: "Can only link up to 3 wallets" }) - if (!existingKeys.includes(key)) - await prisma.userKey.create({ - data: { - key, - user_id, - } - }); - // Remove old linking for this key if existing await prisma.userKey.deleteMany({ where: { key } }) + await prisma.userKey.create({ + data: { + key, + user_id, + } + }); + + return res .status(200) .json({ status: "OK" })