blob: 8a0ce3255f2aa2df1c7c172ef34a80f948735ff1 [file] [log] [blame]
import Axios from 'axios';
const Complete = async (req, res) => {
let code = await Axios.post('http://127.0.0.1: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)
console.log(req.body)
let secret = process.env.VERIFY_SECRET;
let resp = await Axios.get(
`http://127.0.0.1:10000/verify/${req.body.gid}/${req.body.rid}/${req.body.uid}/${secret}/${req.body.code}`
)
return res.send(resp.status);
}
export default Complete;