From 096460ecfe60081a42793baaaa8f356a38d83f7f Mon Sep 17 00:00:00 2001 From: Robert Long Date: Fri, 7 Jan 2022 11:31:53 -0800 Subject: [PATCH] Make recaptcha optional --- src/auth/useRecaptcha.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/auth/useRecaptcha.js b/src/auth/useRecaptcha.js index 0570d1b..c7dc4b4 100644 --- a/src/auth/useRecaptcha.js +++ b/src/auth/useRecaptcha.js @@ -52,6 +52,10 @@ export function useRecaptcha(sitekey) { }, [recaptchaId, sitekey]); const execute = useCallback(() => { + if (!sitekey) { + return Promise.resolve(null); + } + if (!window.grecaptcha) { return Promise.reject(new Error("Recaptcha not loaded")); }