From 6d7d71cbb6752265bb8de799229b3e0828ce05a2 Mon Sep 17 00:00:00 2001 From: fatchan Date: Tue, 21 May 2019 11:58:49 +0000 Subject: [PATCH] fix captcha enabled enforcing --- helpers/captchaverify.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers/captchaverify.js b/helpers/captchaverify.js index eec25ccd..21ee4de9 100644 --- a/helpers/captchaverify.js +++ b/helpers/captchaverify.js @@ -7,7 +7,8 @@ const Captchas = require(__dirname+'/../db/captchas.js') module.exports = async (req, res, next) => { - if (!res.locals.board.settings.captcha) { + //skip captcha if disabled on board for posts only + if (res.locals.board && req.path === `/board/${res.locals.board._id}/post` && !res.locals.board.settings.captcha) { return next(); }