From 3807648cdcd4004b04dedbb1204c4874b8ff3bda Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Wed, 7 Apr 2021 15:54:00 +0200 Subject: [PATCH] :bug: fix register route captcha required --- src/routes/auth/register.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/auth/register.ts b/src/routes/auth/register.ts index 5fbe610e..5501203d 100644 --- a/src/routes/auth/register.ts +++ b/src/routes/auth/register.ts @@ -52,7 +52,7 @@ router.post( let discriminator = ""; // get register Config - const { register } = Config.get(); + const { register, security } = Config.get(); // check if registration is allowed if (!register.allowNewRegistration) { @@ -129,9 +129,9 @@ router.post( } } - if (register.requireCaptcha) { + if (register.requireCaptcha && security.captcha.enabled) { if (!captcha_key) { - const { sitekey, service } = Config.get().security.captcha; + const { sitekey, service } = security.captcha; return res.status(400).json({ captcha_key: ["captcha-required"], captcha_sitekey: sitekey,