Fixed possible undefined error
All checks were successful
Lint / pnpm_install (pull_request) Successful in 2m33s
Test (backend) / unit (22.x) (pull_request) Successful in 7m20s
Test (frontend) / vitest (22.x) (pull_request) Successful in 2m46s
Test (production install and build) / production (22.x) (pull_request) Successful in 3m14s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 3m23s
Lint / lint (backend) (pull_request) Successful in 3m4s
Lint / lint (misskey-js) (pull_request) Successful in 2m45s
Lint / lint (sw) (pull_request) Successful in 2m30s
Lint / lint (frontend) (pull_request) Successful in 9m10s
Lint / typecheck (backend) (pull_request) Successful in 3m58s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m42s
Test (backend) / e2e (22.x) (pull_request) Successful in 10m37s

This commit is contained in:
Ashten 2025-01-18 23:06:39 -08:00
parent 7ed25ef7f5
commit bf1dac8e8b

View file

@ -98,12 +98,11 @@ export class CaptchaService {
const resp = await result.json() as CaptchaResponse;
if (resp.success !== true) {
const errorCodes = resp['error-codes'] ? resp['errors'].join(', ') : '';
const errorCodes = resp['error-codes'] ? resp['errors']?.join(', ') : '';
throw new Error(`frc-failed: ${errorCodes}`);
}
}
// https://codeberg.org/Gusted/mCaptcha/src/branch/main/mcaptcha.go
@bindThis
public async verifyMcaptcha(secret: string, siteKey: string, instanceHost: string, response: string | null | undefined): Promise<void> {