misc: simplified captcha flag and finalized build process

This commit is contained in:
Sheen Capadngan
2024-06-10 13:24:44 +08:00
parent 610dd07a57
commit 0bbb86ee2a
7 changed files with 18 additions and 5 deletions
+1 -2
View File
@@ -122,8 +122,7 @@ const envSchema = z
MAINTENANCE_MODE: zodStrBool.default("false"),
// CAPTCHA
CAPTCHA_SECRET: zpStr(z.string().optional()),
CAPTCHA_ENABLED: zodStrBool.default("false")
CAPTCHA_SECRET: zpStr(z.string().optional())
})
.transform((data) => ({
...data,
@@ -204,7 +204,7 @@ export const authLoginServiceFactory = ({
if (
user.consecutiveFailedPasswordAttempts &&
user.consecutiveFailedPasswordAttempts >= 10 &&
appCfg.CAPTCHA_ENABLED
Boolean(appCfg.CAPTCHA_SECRET)
) {
if (!captchaToken) {
throw new BadRequestError({