mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-14 22:52:41 +01:00
🐛 fix register route captcha required
This commit is contained in:
parent
62af1b918a
commit
3807648cdc
@ -52,7 +52,7 @@ router.post(
|
|||||||
let discriminator = "";
|
let discriminator = "";
|
||||||
|
|
||||||
// get register Config
|
// get register Config
|
||||||
const { register } = Config.get();
|
const { register, security } = Config.get();
|
||||||
|
|
||||||
// check if registration is allowed
|
// check if registration is allowed
|
||||||
if (!register.allowNewRegistration) {
|
if (!register.allowNewRegistration) {
|
||||||
@ -129,9 +129,9 @@ router.post(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (register.requireCaptcha) {
|
if (register.requireCaptcha && security.captcha.enabled) {
|
||||||
if (!captcha_key) {
|
if (!captcha_key) {
|
||||||
const { sitekey, service } = Config.get().security.captcha;
|
const { sitekey, service } = security.captcha;
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
captcha_key: ["captcha-required"],
|
captcha_key: ["captcha-required"],
|
||||||
captcha_sitekey: sitekey,
|
captcha_sitekey: sitekey,
|
||||||
|
Loading…
Reference in New Issue
Block a user