-
Notifications
You must be signed in to change notification settings - Fork 149
Support for Enterprise Action names #289
Copy link
Copy link
Open
Description
Since enterprise version is supported, how about adding support for the Enterprise Actions ?
Docs: https://cloud.google.com/recaptcha-enterprise/docs/actions-website .
Example (see data-action atribute) : https://developers.google.com/recaptcha/docs/v3.
I've already tested and its a easy change:
/src/recaptcha.js
explicitRender() {
const render = this.getCaptchaFunction("render");
if (render && this._widgetId === undefined) {
const wrapper = document.createElement("div");
wrapper.setAttribute("data-action", this.props.dataAction); // Change: Adding the atribute to the div, a new prop (dataAction) is necessary
this._widgetId = render(wrapper, {
sitekey: this.props.sitekey,
callback: this.handleChange,
theme: this.props.theme,
type: this.props.type,
tabindex: this.props.tabindex,
"expired-callback": this.handleExpired,
"error-callback": this.handleErrored,
size: this.props.size,
stoken: this.props.stoken,
hl: this.props.hl,
badge: this.props.badge,
isolated: this.props.isolated,
"data-action": this.props.dataAction, // Change: Pass the action also to the render
});
this.captcha.appendChild(wrapper);
}
...
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels