From d786e96c2bb6d637be7289efdb6766ae4406af1f Mon Sep 17 00:00:00 2001 From: Marie Date: Sat, 2 Nov 2024 02:20:35 +0100 Subject: upd: add FriendlyCaptcha as a captcha solution FriendlyCaptcha is a german captcha solution which is GDPR compliant and has a non-commerical free license --- packages/backend/src/server/api/SignupApiService.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages/backend/src/server/api/SignupApiService.ts') diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index f21e1bd683..db860d710a 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -72,6 +72,7 @@ export class SignupApiService { 'g-recaptcha-response'?: string; 'turnstile-response'?: string; 'm-captcha-response'?: string; + 'frc-captcha-solution'?: string; } }>, reply: FastifyReply, @@ -104,6 +105,12 @@ export class SignupApiService { throw new FastifyReplyError(400, err); }); } + + if (this.meta.enableFC && this.meta.fcSecretKey) { + await this.captchaService.verifyFriendlyCaptcha(this.meta.fcSecretKey, body['frc-captcha-solution']).catch(err => { + throw new FastifyReplyError(400, err); + }); + } } const username = body['username']; -- cgit v1.2.3-freya