This repository was archived by the owner on Mar 26, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR covers the client-side recaptcha work outlined in mozilla/network-pulse-api#762
This gates the login route behind recaptcha validation, if USE_RECAPTCHA is enabled.
Requires mozilla/network-pulse-api#766 on the API-side
Testing
nvm
, set it to use v16 for the duration of testing. v17 upgraded its SSL library in a way that broke a million codebases and making things Node 17 compatible is a whole other can of worms.npm install
.env
file and set it to:where the reCAPTCHA site key is the
localhost (v3)
site key found on https://www.google.com/recaptcha/adminnpm start
You should now be able to load up http://localhost:3000 and click the signin/signup link in the nav bar. Doing so should show you print statements pertaining to recaptcha in your API server terminal fly by. If all went well, you should now be asked to pick how you want to authenticate. Note: that is all you need to see. Actually logging in won't work (due to the gsuite callback URL not being a localhost URL for obvious reasons =D)
Please play around with what happens with
USE_RECAPTCHA
turned off only on the client, only on the server, and off for both: this should fail, pass, and pass respectively.