Moved data outside try scope

master
Keith Irwin 2021-11-24 17:44:34 -07:00
parent 8e69d9d59c
commit da7a3e0992
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 2 additions and 1 deletions

View File

@ -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)