bug
diff --git a/pages/api/rsmv/complete.js b/pages/api/rsmv/complete.js
index 97f02b7..12bd608 100644
--- a/pages/api/rsmv/complete.js
+++ b/pages/api/rsmv/complete.js
@@ -2,17 +2,21 @@
const Complete = async (req, res) => {
let code = await Axios.post('http://localhost:3000/api/rsmv/validate', {code:req.body.code});
+ console.log("1")
if (code.status != 200) {
return res.send(404);
}
+ console.log("2")
if (code.data.user != req.body.uid) return res.send(401)
if (code.data.guild != req.body.gid) return res.send(401)
if (code.data.role != req.body.rid) return res.send(401)
-
+ console.log("3")
+
let secret = "slwu0rZV5W6WdmGtgI16du8Ar2tQGMr3Q9dE6u3poKiVODNV9SweaA3buawgkTmTuITXDWOUpBcTFA0qWrUvoshi1JB180WOFwA7"
let resp = await Axios.get(
`http://192.168.102.5:10000/role/gid/${req.body.gid}/rid/${req.body.rid}/user/${req.body.uid}/secret/${secret}/code/${req.body.code}`
- )
+ )
+ console.log("4")
return res.send(resp.status);
}
diff --git a/pages/api/rsmv/validate.js b/pages/api/rsmv/validate.js
index 0133405..ae42c55 100644
--- a/pages/api/rsmv/validate.js
+++ b/pages/api/rsmv/validate.js
@@ -6,13 +6,14 @@
const collection = 'rsmv-tokens'
const Validate = (req, res) => {
+ console.log("A")
return new Promise((resolve, reject) => {
MongoClient.connect(url, async function(err, client) {
let db_response = await client.db(db).collection(collection).findOne({code: req.body.code});
-
+
if (!db_response) return resolve(res.status(404).end());
if (db_response.timestamp + (1800) >= Date.now()) return resolve(res.status(410));
-
+
let props = {
user: db_response.user,
role: db_response.role,
@@ -22,6 +23,7 @@
guild_icon_url: db_response.guild_icon_url,
guild_size: db_response.guild_size
}
+ console.log("B")
return resolve(res.status(200).send(props));
})
})
diff --git a/pages/api/rsmv/verifyTkn.js b/pages/api/rsmv/verifyTkn.js
index 50eb77e..7254126 100644
--- a/pages/api/rsmv/verifyTkn.js
+++ b/pages/api/rsmv/verifyTkn.js
@@ -2,6 +2,7 @@
import qs from 'querystring';
const verifyTkn = async (req, res) => {
+ console.log("I")
const chk = await Axios.post('https://hcaptcha.com/siteverify', qs.stringify({
response: req.body.tkn,
secret: '0x19C699BFfce07b2a026121DE6702706BB2d51D6c',