Skip to content

Commit

Permalink
fix: fix captcha widget
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Sep 9, 2022
1 parent 2723f52 commit b4d990c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/Widget/Captcha.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ class Captcha extends React.Component {
return (
<HoneypotCaptchaWidget
id={captcha_props.id}
id_check={captcha_props.id_check}
title={captcha_props.title}
title={captcha_props.id}
captchaRef={captchaRef}
captchaToken={captchaToken}
/>
Expand Down
7 changes: 3 additions & 4 deletions src/components/Widget/HoneypotCaptchaWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import './HoneypotCaptchaWidget.css';
* @function HoneypotCaptchaWidget
* @returns {string} Markup of the component.
*/
const HoneypotCaptchaWidget = ({ id, id_check, title, captchaToken }) => {
const createToken = (id, id_check, value) => {
const HoneypotCaptchaWidget = ({ id, title, captchaToken }) => {
const createToken = (id, value) => {
const token = {
id: id,
id_check: id_check,
value: value,
};
return JSON.stringify(token);
Expand All @@ -31,7 +30,7 @@ const HoneypotCaptchaWidget = ({ id, id_check, title, captchaToken }) => {
label={title}
title={title}
onChange={(field, value) => {
captchaToken.current = createToken(id, id_check, value);
captchaToken.current = createToken(id, value);
setValue(value);
}}
value={value}
Expand Down

0 comments on commit b4d990c

Please sign in to comment.