pineafan | c540da9 | 2021-09-03 20:33:36 +0100 | [diff] [blame] | 1 | import Axios from 'axios'; |
| 2 | |
| 3 | export default async (req, res) => { |
| 4 | let code = await Axios.post('http://localhost:3000/api/rsmv/validate', {code:req.body.code}); |
| 5 | if (code.status != 200) { |
| 6 | return res.send(404); |
| 7 | } |
| 8 | if (code.data.user != req.body.uid) return res.send(401) |
| 9 | if (code.data.guild != req.body.gid) return res.send(401) |
| 10 | if (code.data.role != req.body.rid) return res.send(401) |
| 11 | |
| 12 | let secret = "slwu0rZV5W6WdmGtgI16du8Ar2tQGMr3Q9dE6u3poKiVODNV9SweaA3buawgkTmTuITXDWOUpBcTFA0qWrUvoshi1JB180WOFwA7" |
| 13 | let resp = await Axios.get( |
| 14 | `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}` |
| 15 | ) |
| 16 | return res.send(resp.status); |
| 17 | } |