blob: 1b58a04735a53cf216cfc598fb625b3094589c4d [file] [log] [blame]
pineafanfd93e6e2022-05-06 20:30:09 +01001import Axios from 'axios';
2import qs from 'querystring';
3
4const 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
22export default Complete;