Skip to main content

validateCapcha

This method allows you to validate capcha tokens.

Description

Validates a CAPTCHA token by sending it to the server for verification.

System.validateCapcha(

data,

);

Parameters schema

Schema

data: ICaptchaData
The event object containing CAPTCHA data.
example:

{
"token": "03AGdBq24...",
"expectedAction": "login",
"siteKey": "6Lc_aCMTAAAAAB..."
}

data.token: string
The CAPTCHA token to be validated.
example: "03AGdBq24...".


data.expectedAction: string
The expected action associated with the CAPTCHA.
example: "login".


data.siteKey: string
The site key used for the CAPTCHA.
example: "6Lc_aCMTAAAAAB...".


Examples

Minimal example

const data = {
"token": "03AGdBq24...",
"expectedAction": "login",
"siteKey": "6Lc_aCMTAAAAAB..."
};

const response = await System.validateCapcha(data);

Returns response from the server after validating the CAPTCHA, or an error object if validation fails.

Example response