How can I switch from reCaptcha v2 to reCaptcha v3 on a form submission?

Hi,

I want to replace v2 version of google reCaptcha on

/ContactPassword

form submission. I have tried to implement the code as https://developers.google.com/recaptcha/docs/v3 . It is showing reCaptcha v3 on the form page but once i submit the form it is still redirecting me to reCaptcha v2 page, which shows “404 not found” error.

Please help me ASAP.

Thanks.