summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/SignupApiService.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-10-11 21:05:53 +0900
committerGitHub <noreply@github.com>2024-10-11 21:05:53 +0900
commitaf1cbc131fc9e045692f9f9def708c0978817fff (patch)
tree84143fc3e0d9a889a6005ddb62e08298087c8acf /packages/backend/src/server/api/SignupApiService.ts
parentchore: add description (diff)
downloadsharkey-af1cbc131fc9e045692f9f9def708c0978817fff.tar.gz
sharkey-af1cbc131fc9e045692f9f9def708c0978817fff.tar.bz2
sharkey-af1cbc131fc9e045692f9f9def708c0978817fff.zip
wip (#14745)
Diffstat (limited to 'packages/backend/src/server/api/SignupApiService.ts')
-rw-r--r--packages/backend/src/server/api/SignupApiService.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts
index c499638018..3ec5e5d3e6 100644
--- a/packages/backend/src/server/api/SignupApiService.ts
+++ b/packages/backend/src/server/api/SignupApiService.ts
@@ -67,6 +67,7 @@ export class SignupApiService {
'g-recaptcha-response'?: string;
'turnstile-response'?: string;
'm-captcha-response'?: string;
+ 'testcaptcha-response'?: string;
}
}>,
reply: FastifyReply,
@@ -99,6 +100,12 @@ export class SignupApiService {
throw new FastifyReplyError(400, err);
});
}
+
+ if (this.meta.enableTestcaptcha) {
+ await this.captchaService.verifyTestcaptcha(body['testcaptcha-response']).catch(err => {
+ throw new FastifyReplyError(400, err);
+ });
+ }
}
const username = body['username'];