📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
remove obsolete validation data
Blue Mouse2b976f796177
diff --git a/src/captcha/captcha.controller.ts b/src/captcha/captcha.controller.tsindex b517124ef..f5ae04262 100644--- a/src/captcha/captcha.controller.ts+++ b/src/captcha/captcha.controller.ts@@ -187,12 +187,12 @@ export class CaptchaController {this.logger.log({ validateDTO }, 'POST /captcha/validate')const {- token, secret, hash, timestamp,+ token, secret,} = validateDTOreturn {success: true,- data: this.captchaService.validateToken(token, secret, hash, timestamp),+ data: this.captchaService.validateToken(token, secret),}}}diff --git a/src/captcha/captcha.service.ts b/src/captcha/captcha.service.tsindex d699e3a07..6255217e7 100644--- a/src/captcha/captcha.service.ts+++ b/src/captcha/captcha.service.ts@@ -110,7 +110,7 @@ export class CaptchaService {return encryptString(JSON.stringify(token), secretKey)}- validateToken(token: string, secretKey: string, hash: string, timestamp: number): object {+ validateToken(token: string, secretKey: string): object {let parsedtry {@@ -120,14 +120,6 @@ export class CaptchaService {throw new BadRequestException('Could not decrypt token')}- if (!parsed.autoVerified && parsed.hash !== hash) {- throw new BadRequestException('Token: captcha pass hash does not match')- }-- if (parsed.timestamp !== timestamp) {- throw new BadRequestException('Token: timestamp does not match')- }-return parsed}diff --git a/src/captcha/dtos/validate.dto.ts b/src/captcha/dtos/validate.dto.tsindex f2b83f101..f8d1bf1c2 100644--- a/src/captcha/dtos/validate.dto.ts+++ b/src/captcha/dtos/validate.dto.ts@@ -1,5 +1,5 @@import { ApiProperty } from '@nestjs/swagger'-import { IsNotEmpty, IsOptional } from 'class-validator'+import { IsNotEmpty } from 'class-validator'export class ValidateDTO {@ApiProperty({@@ -15,18 +15,4 @@ export class ValidateDTO {})@IsNotEmpty()secret: string-- @ApiProperty({- required: false,- description: 'Captcha hash (if available)',- })- @IsOptional()- hash?: string-- @ApiProperty({- required: true,- description: 'Captcha pass timestamp',- })- @IsNotEmpty()- timestamp: number}