From 9ff80d7ec4c0267a92d4cfe185c67a8ebf8d53db Mon Sep 17 00:00:00 2001 From: VictoriqueMoe Date: Sun, 17 Mar 2024 19:20:55 +0000 Subject: [PATCH] cleanup --- .../captcha/{TurnstileCaptcha.ts => TurnstileCaptchaEngine.ts} | 2 +- src/engine/impl/index.ts | 3 ++- src/manager/CaptchaManager.ts | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) rename src/engine/impl/captcha/{TurnstileCaptcha.ts => TurnstileCaptchaEngine.ts} (92%) diff --git a/src/engine/impl/captcha/TurnstileCaptcha.ts b/src/engine/impl/captcha/TurnstileCaptchaEngine.ts similarity index 92% rename from src/engine/impl/captcha/TurnstileCaptcha.ts rename to src/engine/impl/captcha/TurnstileCaptchaEngine.ts index 83a4968..6181c0e 100644 --- a/src/engine/impl/captcha/TurnstileCaptcha.ts +++ b/src/engine/impl/captcha/TurnstileCaptchaEngine.ts @@ -10,7 +10,7 @@ import { Logger } from "@tsed/common"; scope: ProviderScope.SINGLETON, type: CAPTCHA_ENGINE, }) -export class TurnstileCaptcha extends AbstractCaptchaEngine { +export class TurnstileCaptchaEngine extends AbstractCaptchaEngine { @Constant(GlobalEnv.CAPTCHA_SECRET_KEY) private readonly turnstileSecretKey: string; diff --git a/src/engine/impl/index.ts b/src/engine/impl/index.ts index 5b0621c..d3d1e83 100644 --- a/src/engine/impl/index.ts +++ b/src/engine/impl/index.ts @@ -5,8 +5,9 @@ export * from "./av/ClamAvEngine.js"; export * from "./av/MsDefenderEngine.js"; export * from "./captcha/AbstractCaptchaEngine.js"; +export * from "./captcha/HcaptchaEngine.js"; export * from "./captcha/ReCAPTCHAEngine.js"; -export * from "./captcha/TurnstileCaptcha.js"; +export * from "./captcha/TurnstileCaptchaEngine.js"; export * from "./HttpErrorRenderers/AuthenticationErrorRenderEngine.js"; export * from "./HttpErrorRenderers/DefaultHttpRenderEngine.js"; export * from "./HttpErrorRenderers/FileProtectedRenderEngine.js"; diff --git a/src/manager/CaptchaManager.ts b/src/manager/CaptchaManager.ts index 7d2c7dd..cf963bc 100644 --- a/src/manager/CaptchaManager.ts +++ b/src/manager/CaptchaManager.ts @@ -15,6 +15,8 @@ export class CaptchaManager { this._engine = captchaFactory.getEnabledService(); if (this._engine === null) { this.logger.warn("No captcha service is enabled"); + } else { + this.logger.info(`Using ${this._engine.type} as captcha service`); } }