From 812c70e0dababa81bb4f1a33d7caa99e0970e51a Mon Sep 17 00:00:00 2001 From: HF Date: Thu, 21 Jul 2022 09:54:50 +0200 Subject: [PATCH] remove captcha logging to chat again --- src/data/redis/captcha.js | 4 +++- src/routes/api/captcha.js | 10 ---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/data/redis/captcha.js b/src/data/redis/captcha.js index 79333530..737b70bb 100644 --- a/src/data/redis/captcha.js +++ b/src/data/redis/captcha.js @@ -130,7 +130,9 @@ export async function checkCaptchaSolution( logger.info( `CAPTCHA ${ip} got captcha wrong (${text} instead of ${solution})`, ); - wrongCallback(text, solution); + if (wrongCallback) { + wrongCallback(text, solution); + } return 2; } logger.info(`CAPTCHA ${ip}:${captchaid} timed out`); diff --git a/src/routes/api/captcha.js b/src/routes/api/captcha.js index 6811df6d..c1eff75e 100644 --- a/src/routes/api/captcha.js +++ b/src/routes/api/captcha.js @@ -8,7 +8,6 @@ import logger from '../../core/logger'; import { checkCaptchaSolution } from '../../data/redis/captcha'; import { getIPFromRequest } from '../../utils/ip'; -import chatProvider from '../../core/ChatProvider'; export default async (req, res) => { const ip = getIPFromRequest(req); @@ -32,15 +31,6 @@ export default async (req, res) => { ip, false, id, - (inpt, solution) => { - chatProvider.broadcastChatMessage( - 'info', - // eslint-disable-next-line max-len - `Someone got his captcha wrong and entered ${inpt} instead of ${solution}`, - chatProvider.enChannelId, - chatProvider.infoUserId, - ); - }, ); switch (ret) {