summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-07 15:54:00 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-07 15:54:00 +0200
commit3807648cdcd4004b04dedbb1204c4874b8ff3bda (patch)
treeb89c24b0d7f8b4cb82c73c82bd6ff34ee4b76a95
parentMerge pull request #83 from notsapinho/master (diff)
downloadserver-3807648cdcd4004b04dedbb1204c4874b8ff3bda.tar.xz
:bug: fix register route captcha required
-rw-r--r--src/routes/auth/register.ts6
1 files 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,