pineafan | c540da9 | 2021-09-03 20:33:36 +0100 | [diff] [blame] | 1 | import Axios from 'axios'; |
| 2 | import qs from 'querystring'; |
| 3 | |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 4 | const verifyTkn = async (req, res) => { |
pineafan | c540da9 | 2021-09-03 20:33:36 +0100 | [diff] [blame] | 5 | 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' |
| 9 | })) |
| 10 | |
| 11 | return res.send({ success: chk.data.success }); |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | export default verifyTkn; |