| import Axios from 'axios'; |
| import qs from 'querystring'; |
| |
| const Complete = async (req, res) => { |
| const chk = await Axios.post('https://hcaptcha.com/siteverify', qs.stringify({ |
| response: req.body.tkn, |
| secret: '0x19C699BFfce07b2a026121DE6702706BB2d51D6c', |
| sitekey: '85074411-fa13-4d9b-b901-53095c6d1fc6' |
| })) |
| if ( !chk.data.success ) { |
| return res.status(200).send({success: false}) |
| } |
| try { |
| await Axios.post(`http://${process.env.NUCLEUS_CALLBACK}/verify/${req.body.code}`, { |
| secret: process.env.VERIFY_SECRET |
| }); |
| } catch (e) { |
| return res.status(200).send({success: false}) |
| } |
| return res.status(200).send({success: true}); |
| } |
| |
| export default Complete; |