shahradelahi / react-geetest

React library for GeeTest captcha integration
https://www.npmjs.com/package/react-geetest-v4
MIT License
59 stars 11 forks source link

Reset the captcha validation or clear captcha when some API Server if its error #4

Closed rahXephonz closed 10 months ago

rahXephonz commented 11 months ago

basically i have logic for signin in here

signInWithOTP(
        {...jsonPayload, ...geetestData},
        {onError: () => {/*do in here*/}}
)

how to reseting the captcha from start if some error happen?

shahradelahi commented 11 months ago
  const captchaRef = React.useRef<GeeTestRef | null>(null)
  const handleLogin = () => {
    try {
      // do login
    } catch (e) {
      // handle error
    } finally {
      // reset captcha
      captchaRef.current?.reset()
    }
  }
rahXephonz commented 11 months ago

Thanks @shahradelahi !!! Awesome :) 👍🏿

rahXephonz commented 10 months ago

Hello @shahradelahi did you know how to change captcha challenge from slide into another? Thanks

shahradelahi commented 10 months ago

Hello @rahXephonz, To change the Geetest security strategy, refer to their console/dashboard and apply the changes on the Customization > Security strategy page. If you want more product support, you can contact the Geetest support team.