Skip to content

Commit

Permalink
Replace google.com with recaptcha.net (#4284)
Browse files Browse the repository at this point in the history
* Replace google.com with recaptcha.net

* Update doc
  • Loading branch information
yifanmai authored Nov 2, 2022
1 parent c5fbe64 commit d269492
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion codalab/rest/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/components/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit d269492

Please sign in to comment.