This commit is contained in:
syuilo
2024-10-11 21:05:53 +09:00
committed by GitHub
parent c397b42242
commit af1cbc131f
19 changed files with 130 additions and 7 deletions

View File

@@ -119,5 +119,18 @@ export class CaptchaService {
throw new Error(`turnstile-failed: ${errorCodes}`);
}
}
@bindThis
public async verifyTestcaptcha(response: string | null | undefined): Promise<void> {
if (response == null) {
throw new Error('testcaptcha-failed: no response provided');
}
const success = response === 'testcaptcha-passed';
if (!success) {
throw new Error('testcaptcha-failed');
}
}
}