From 5d6ee6f907661c1ce351ad09c6725eb2a984971f Mon Sep 17 00:00:00 2001 From: moepoi Date: Sun, 21 Nov 2021 14:31:58 +0700 Subject: [PATCH] recover --- routes/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/api.js b/routes/api.js index 3ee5a5c..33d2233 100644 --- a/routes/api.js +++ b/routes/api.js @@ -244,7 +244,7 @@ router.post("/login", async (req, res) => { router.post("/verify-mail", async (req, res) => { const conn = db.connect(); conn.query( - 'SELECT * FROM users WHERE token ="' + req.query.token + '"', + 'SELECT * FROM users WHERE token ="' + req.body.token + '"', function (err, result) { if (err) { res.status(400); @@ -258,7 +258,7 @@ router.post("/verify-mail", async (req, res) => { verify: 1, token: randtoken.generate(64), }; - db_connect.query( + conn.query( 'UPDATE users SET ? WHERE email ="' + result[0].email + '"', data, function (err, result) {