From 230d3ad54fdb48b4aa3a22f3c3de162eb811c714 Mon Sep 17 00:00:00 2001 From: adithya_dinesh Date: Thu, 28 Mar 2024 12:46:16 +0530 Subject: [PATCH 1/2] Adding new APIs to captcha --- src/constants/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/common.js b/src/constants/common.js index 74c54835d..9724f558a 100644 --- a/src/constants/common.js +++ b/src/constants/common.js @@ -89,5 +89,5 @@ module.exports = { DELETED_STATUS: 'DELETED', DEFAULT_ORG_VISIBILITY: 'PUBLIC', ROLE_TYPE_NON_SYSTEM: 0, - captchaEnabledAPIs: ['/user/v1/account/login'], + captchaEnabledAPIs: ['/user/v1/account/login', '/user/v1/account/create', '/user/v1/account/resetPassword'], } From f78b051406efe22fd1a0ef04e58d8239026a63df Mon Sep 17 00:00:00 2001 From: adithya_dinesh Date: Thu, 28 Mar 2024 13:43:58 +0530 Subject: [PATCH 2/2] captcha token variable updated --- src/middlewares/authenticator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middlewares/authenticator.js b/src/middlewares/authenticator.js index c5fe0e42c..5f303c345 100644 --- a/src/middlewares/authenticator.js +++ b/src/middlewares/authenticator.js @@ -67,7 +67,7 @@ module.exports = async function (req, res, next) { const isCaptchaEnabledForRoute = common.captchaEnabledAPIs.includes(req.path) if (isCaptchaEnabledForRoute) { // get the token from API - const captchaToken = req.get('Captcha-Token') + const captchaToken = req.get('captcha-token') // verify token if (!(await verifyCaptchaToken(captchaToken))) { throw responses.failureResponse({