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!

fix autopass for dummy tokens

Blue Mouse1312bfc75ac4
diff --git a/src/captcha/captcha.controller.ts b/src/captcha/captcha.controller.ts
index 1c2b6bd02..8075d6ac8 100644
--- a/src/captcha/captcha.controller.ts
+++ b/src/captcha/captcha.controller.ts
@@ -168,12 +168,6 @@ export class CaptchaController {
let decrypted
- try {
- decrypted = await this.captchaService.decryptTokenCaptcha(tokenCookie)
- } catch (e) {
- throw new InternalServerErrorException('Could not decrypt captcha cookie')
- }
-
const timestamp = dayjs.utc().unix()
const token = await this.captchaService.generateToken(pid, null, timestamp, true)
@@ -186,6 +180,12 @@ export class CaptchaController {
}
}
+ try {
+ decrypted = await this.captchaService.decryptTokenCaptcha(tokenCookie)
+ } catch (e) {
+ throw new InternalServerErrorException('Could not decrypt captcha cookie')
+ }
+
const {
manuallyVerified, automaticallyVerified,
} = this.captchaService.incrementAutomaticallyVerified(decrypted)