From da7a3e099240963daa2344b5f05b5dc3d2851231 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Wed, 24 Nov 2021 17:44:34 -0700 Subject: [PATCH] Moved data outside try scope --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 11a7c7d..a734cf9 100644 --- a/index.js +++ b/index.js @@ -24,8 +24,9 @@ app.post('/', async (req, res) => { console.log(`Received POST`) console.log(req.body) // Check token + let data try { - const data = await verify(process.env.HCAPTCHA_SECRET, req.body['token']) + data = await verify(process.env.HCAPTCHA_SECRET, req.body['token']) } catch (err) { console.error(`Failed to check hcaptcha\n${err}`) return res.sendStatus(500)