diff --git a/codalab/rest/account.py b/codalab/rest/account.py index a3683d1f5..6fa0715d3 100644 --- a/codalab/rest/account.py +++ b/codalab/rest/account.py @@ -78,7 +78,8 @@ def do_signup(): if not token: errors.append('Google reCAPTCHA token is missing.') else: - url = 'https://www.google.com/recaptcha/api/siteverify' + # URL from https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally + url = 'https://www.recaptcha.net/recaptcha/api/siteverify' data = { 'secret': os.environ['CODALAB_RECAPTCHA_SECRET_KEY'], 'response': token, diff --git a/frontend/src/components/SignUp.js b/frontend/src/components/SignUp.js index 1a5c4ec7e..cfa5a50cc 100644 --- a/frontend/src/components/SignUp.js +++ b/frontend/src/components/SignUp.js @@ -5,6 +5,13 @@ import ContentWrapper from './ContentWrapper'; import queryString from 'query-string'; import ReCAPTCHA from 'react-google-recaptcha'; +// Set global properties used by reCaptcha +// See: https://www.npmjs.com/package/react-google-recaptcha#global-properties-used-by-recaptcha +window.recaptchaOptions = { + // Use recaptcha.net to avoid blocks on google.com + useRecaptchaNet: true, +}; + export const SignUpSuccess = (props) => { const { email } = queryString.parse(props.location.search); return (