Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

clean-up

Blue Mousea470b2c02516
diff --git a/src/captcha/captcha.controller.ts b/src/captcha/captcha.controller.ts
index 8fb2f2d4d..1c2b6bd02 100644
--- a/src/captcha/captcha.controller.ts
+++ b/src/captcha/captcha.controller.ts
@@ -42,7 +42,7 @@ export class CaptchaController {
await this.captchaService.validatePIDForCAPTCHA(pid)
- return await this.captchaService.generateCaptcha(theme, pid)
+ return await this.captchaService.generateCaptcha(theme)
}
@Post('/verify-manual')
@@ -68,7 +68,7 @@ export class CaptchaController {
await this.captchaService.validatePIDForCAPTCHA(pid)
- if (pid === DUMMY_PIDS.ALWAYS_FAIL || !this.captchaService.verifyCaptcha(code, hash, pid)) {
+ if (pid === DUMMY_PIDS.ALWAYS_FAIL || !this.captchaService.verifyCaptcha(code, hash)) {
throw new ForbiddenException('Incorrect captcha')
}
diff --git a/src/captcha/captcha.service.ts b/src/captcha/captcha.service.ts
index 6cfedf2d2..a87c06e3b 100644
--- a/src/captcha/captcha.service.ts
+++ b/src/captcha/captcha.service.ts
@@ -220,7 +220,7 @@ export class CaptchaService {
return hash(captchaString(text)).toString('hex')
}
- async generateCaptcha(theme: string, pid: string): Promise<GeneratedCaptcha> {
+ async generateCaptcha(theme: string): Promise<GeneratedCaptcha> {
const themeParams = theme === 'light' ? {} : {
background: '#1f2937',
color: true,
@@ -242,7 +242,7 @@ export class CaptchaService {
}
}
- verifyCaptcha(text: string, hash: string, pid: string): boolean {
+ verifyCaptcha(text: string, hash: string): boolean {
return hash === this.hashCaptcha(text)
}