blob: d8b6a0fb080d6f85e918846a20f65ad3eefaa4b0 [file] [log] [blame]
pineafanfd93e6e2022-05-06 20:30:09 +01001import Axios from 'axios';
2import qs from 'querystring';
3
4const Complete = async (req, res) => {
pineafanaa9c4fd2022-06-10 19:58:10 +01005 const chk = await Axios.post('https://hcaptcha.com/siteverify', qs.stringify({
6 response: req.body.tkn,
7 secret: '0x19C699BFfce07b2a026121DE6702706BB2d51D6c',
8 sitekey: '85074411-fa13-4d9b-b901-53095c6d1fc6'
pineafanfd93e6e2022-05-06 20:30:09 +01009 }))
10 if ( !chk.data.success ) {
11 return res.status(200).send({success: false})
12 }
pineafanfd93e6e2022-05-06 20:30:09 +010013 try {
Skyler Grey6c3d4632023-03-06 09:51:21 +000014 await Axios.post(`${process.env.NUCLEUS_CALLBACK}verify/${req.body.code}`, {
pineafan83152e22022-06-13 17:52:55 +010015 secret: process.env.VERIFY_SECRET
pineafanfd93e6e2022-05-06 20:30:09 +010016 });
17 } catch (e) {
18 return res.status(200).send({success: false})
19 }
20 return res.status(200).send({success: true});
21}
22
Skyler Grey6c3d4632023-03-06 09:51:21 +000023export default Complete;