Make recaptcha optional
This commit is contained in:
@@ -52,6 +52,10 @@ export function useRecaptcha(sitekey) {
|
|||||||
}, [recaptchaId, sitekey]);
|
}, [recaptchaId, sitekey]);
|
||||||
|
|
||||||
const execute = useCallback(() => {
|
const execute = useCallback(() => {
|
||||||
|
if (!sitekey) {
|
||||||
|
return Promise.resolve(null);
|
||||||
|
}
|
||||||
|
|
||||||
if (!window.grecaptcha) {
|
if (!window.grecaptcha) {
|
||||||
return Promise.reject(new Error("Recaptcha not loaded"));
|
return Promise.reject(new Error("Recaptcha not loaded"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user