forked from woem.men/forkey
Fixed possible undefined error
This commit is contained in:
parent
7ed25ef7f5
commit
bf1dac8e8b
1 changed files with 1 additions and 2 deletions
|
@ -98,12 +98,11 @@ export class CaptchaService {
|
||||||
const resp = await result.json() as CaptchaResponse;
|
const resp = await result.json() as CaptchaResponse;
|
||||||
|
|
||||||
if (resp.success !== true) {
|
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}`);
|
throw new Error(`frc-failed: ${errorCodes}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// https://codeberg.org/Gusted/mCaptcha/src/branch/main/mcaptcha.go
|
// https://codeberg.org/Gusted/mCaptcha/src/branch/main/mcaptcha.go
|
||||||
@bindThis
|
@bindThis
|
||||||
public async verifyMcaptcha(secret: string, siteKey: string, instanceHost: string, response: string | null | undefined): Promise<void> {
|
public async verifyMcaptcha(secret: string, siteKey: string, instanceHost: string, response: string | null | undefined): Promise<void> {
|
||||||
|
|
Loading…
Reference in a new issue