pineafan | fd93e6e | 2022-05-06 20:30:09 +0100 | [diff] [blame^] | 1 | import Axios from 'axios'; |
| 2 | import qs from 'querystring'; |
| 3 | |
| 4 | const Complete = async (req, res) => { |
| 5 | const chk = await Axios.post('http://localhost:3000/api/nucleus/verify/verifyToken', qs.stringify({ |
| 6 | tkn: req.body.tkn |
| 7 | })) |
| 8 | if ( !chk.data.success ) { |
| 9 | return res.status(200).send({success: false}) |
| 10 | } |
| 11 | let secret = "slwu0rZV5W6WdmGtgI16du8Ar2tQGMr3Q9dE6u3poKiVODNV9SweaA3buawgkTmTuITXDWOUpBcTFA0qWrUvoshi1JB180WOFwA7" |
| 12 | try { |
| 13 | await Axios.post(`http://192.168.0.18:10000/verify/${req.body.code}`, { |
| 14 | secret: secret |
| 15 | }); |
| 16 | } catch (e) { |
| 17 | return res.status(200).send({success: false}) |
| 18 | } |
| 19 | return res.status(200).send({success: true}); |
| 20 | } |
| 21 | |
| 22 | export default Complete; |