Page 1 of 1

Edit Captcha src url

Posted: 16 Dec 2022, 18:58
by Harsha Bulusu
Hi,

I would like to bring to your notice that we don't have a way to edit the Captcha source URL by default it using google Recaptcha but we have a concern that some countries like China don't allow google resources in order to fulfill our requirement is there a possible way or can you make it as an enhancement.

Captcha component existing code

const addRecaptchaScript = () => {
recaptchaScript.current = null;

if (!window.grecaptcha) {
let head = document.head || document.getElementsByTagName('head')[0];
let script = document.createElement('script');

script.src = 'https://www.google.com/recaptcha/api.js?render=explicit';
script.async = true;
script.defer = true;

script.onload = () => {
if (!window.grecaptcha) {
// eslint-disable-next-line no-console
console.warn('Recaptcha is not loaded');

return;
}

window.grecaptcha.ready(() => {
init();
});
};

recaptchaScript.current = script;

head.appendChild(recaptchaScript.current);
}
};

Thanking you in advance

Re: Edit Captcha src url

Posted: 20 Dec 2022, 08:25
by habubey
Hey there,
Thank you so much for the sample we will consider it.
Best

Re: Edit Captcha src url

Posted: 21 Dec 2022, 11:29
by Harsha Bulusu
Thanks for considering this is there any alternative is there a possibility for extending your component to override a method for editing src url

Re: Edit Captcha src url

Posted: 02 Jan 2023, 14:26
by wish79
Why we need primereact captcha tag to give us the ability to change the google url, because in some country the google url blocked so google provide another url which is accessible in theses countries

read this doc from google can-i-use-recaptcha-globally https://developers.google.com/recaptcha ... -globally ,

so our request how can i change the google captcha url in primereact Tag

Re: Edit Captcha src url

Posted: 27 Jan 2023, 14:18
by mert.sincan
Hi,

This is not related to Apollo. Please use github or PrimeReact forum. Thanks a lot for your understanding!

Best Regards,