diff --git a/public/hcaptcha.svg b/public/hcaptcha.svg new file mode 100644 index 00000000..fb514f2e --- /dev/null +++ b/public/hcaptcha.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/client.js b/src/client.js index 913c4d94..11c1dd69 100644 --- a/src/client.js +++ b/src/client.js @@ -135,10 +135,12 @@ window.onCaptcha = async function onCaptcha(token: string) { credentials: 'include', }); - const { - i, j, offset, color, - } = window.pixel; - store.dispatch(tryPlacePixel(i, j, offset, color)); + if (window.pixel) { + const { + i, j, offset, color, + } = window.pixel; + store.dispatch(tryPlacePixel(i, j, offset, color)); + } if (typeof window.hcaptcha !== 'undefined') { window.hcaptcha.reset(); diff --git a/src/components/UserArea.jsx b/src/components/UserArea.jsx index d70e8573..26c9f9f9 100644 --- a/src/components/UserArea.jsx +++ b/src/components/UserArea.jsx @@ -156,6 +156,25 @@ class UserArea extends React.Component { done={() => { this.setState({ deleteAccountExtended: false }); }} /> )} + {(typeof window.hcaptcha !== 'undefined') + && ( + hCaptcha { + window.pixel = null; + window.hcaptcha.execute(); + }} + style={{ + width: '5%', + height: '5%', + paddingTop: 20, + cursor: 'pointer', + }} + /> + )}

); }