blob: 3259967505020f6b4dcb695b319dce9a9d4fd901 [file] [log] [blame]
import Axios from 'axios';
export default async (req, res) => {
let code = await Axios.post('http://localhost:3000/api/rsmv/validate', {code:req.body.code});
if (code.status != 200) {
return res.send(404);
}
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)
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}`
)
return res.send(resp.status);
}