Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: recaptcha added #227

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

akshitarora921
Copy link
Contributor

@akshitarora921 akshitarora921 commented Oct 3, 2021

Self-Review Checklist

  • PR title is clear with proper spelling and grammar
  • PR description contains a bulleted list of changes contained in the PR
  • PR links to relevant issues, with keywords to auto-close any issues fully resolved upon merge
  • All automated checks passed
  • Any variables introduced are named clearly and explicitly
    One variable added :
  • File .env.example NEXT_PUBLIC_SITE_KEY

Steps to generate Site Key:

  • Login to the google reCaptcha website
  • Click in Plus button(Create) in the second bar.
    image
  • Fill in the details
  • Select this configuration
    image
  • In the domain add the site domain for which you want reCaptcha to work.
    eg: https://www.margaritahumanitarian.org/ or localhost
  • Multiple owners can be added also.
  • Click on accept and submit
  • Site code will be generated now. Copy that code and paste it into the env file.

closes #162

@vercel
Copy link

vercel bot commented Oct 3, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/margaritahumanitarian/helpafamily/7hhfbYi2rYxEc2tjUR5ZFHJjHpuw
✅ Preview: https://helpafamily-git-fork-akshitarora92-1f1867-margaritahumanitarian.vercel.app

@akshitarora921
Copy link
Contributor Author

akshitarora921 commented Oct 4, 2021

Need to do 2 things:

  • add site code from margaritahumanitarian account.(Currently I am using my account)
  • fetch site-code from .env file. (I tried but its giving error line 129 components/MainDonationForm.js)

components/MainDonationForm.js Outdated Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
@akshitarora921
Copy link
Contributor Author

akshitarora921 commented Oct 5, 2021

Any update on this? @audreyfeldroy

@LowLifeArcade
Copy link
Collaborator

@akshitarora921 so did we figure out what we're doing with the keys here?

@@ -2,7 +2,7 @@ STRIPE_SECRET_KEY = "sk_test_51JJ3vNLOlCyqSHKrp2vu93c9YzrXxDq7otphDYZqQTE10eZ0Gs
CANCEL_URL = "https://helpafamily.margaritahumanitarian.org/"
SUCCESS_URL = "https://helpafamily.margaritahumanitarian.org/thank-you"
NEXT_PUBLIC_GMAPS_JS_API_KEY = "<your Google Maps JavaScript API Key here>"

NEXT_PUBLIC_SITE_KEY=6LcjyaccAAAAAAjE2z6vBhs2tOdhC-t0F2OCMj7z
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akshitarora921 So let's get this part figured out and we can get this PR in! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Collaborator

@LowLifeArcade LowLifeArcade Oct 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @akshitarora921. So I think what would help a lot is for you to explain what you're doing with these keys.

  • Where are they from
  • What are they doing
  • What we need to do

I've looked into it and it might be better next time for us to get your PR through if you outline what we need to do as a follow up to your work. A list of todos. Here's an example for todos for us:

  • Go to recaptha website and generate keys for production
  • Use sitekey in code (go into detail)
  • Use secret key in server env (go into detail)

This would help a lot.

@LowLifeArcade
Copy link
Collaborator

@akshitarora921 if you would rebase your codebase (fetch upstream or go to your forked repo and click fetch) as well so everything is up to date. 🙏

@@ -2,7 +2,7 @@ STRIPE_SECRET_KEY = "sk_test_51JJ3vNLOlCyqSHKrp2vu93c9YzrXxDq7otphDYZqQTE10eZ0Gs
CANCEL_URL = "https://helpafamily.margaritahumanitarian.org/"
SUCCESS_URL = "https://helpafamily.margaritahumanitarian.org/thank-you"
NEXT_PUBLIC_GMAPS_JS_API_KEY = "<your Google Maps JavaScript API Key here>"

NEXT_PUBLIC_SITE_KEY=6LcjyaccAAAAAAjE2z6vBhs2tOdhC-t0F2OCMj7z
Copy link
Collaborator

@LowLifeArcade LowLifeArcade Oct 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @akshitarora921. So I think what would help a lot is for you to explain what you're doing with these keys.

  • Where are they from
  • What are they doing
  • What we need to do

I've looked into it and it might be better next time for us to get your PR through if you outline what we need to do as a follow up to your work. A list of todos. Here's an example for todos for us:

  • Go to recaptha website and generate keys for production
  • Use sitekey in code (go into detail)
  • Use secret key in server env (go into detail)

This would help a lot.

@LowLifeArcade
Copy link
Collaborator

LowLifeArcade commented Oct 6, 2021

Need to do 2 things:

  • add site code from margaritahumanitarian account.(Currently I am using my account)
  • fetch site-code from .env file. (I tried but its giving error line 129 components/MainDonationForm.js)

I see you did this which is nice. Maybe a little more detail to help us get this PR through. I’ve updated your PR description with a Self-Review Checklist and some to-dos.

I also noticed that one of the checks failed. Please take a look and let me know if you need help.

@akshitarora921
Copy link
Contributor Author

@LowLifeArcade updated PR description.

@LowLifeArcade
Copy link
Collaborator

@LowLifeArcade updated PR description.

Thank you @akshitarora921. Don't worry, we'll get this PR through soon. The test failure might be due to recaptcha doing its job. I don't know this for sure and will have to look into it.

@akshitarora921
Copy link
Contributor Author

@LowLifeArcade yes the form does not submit until the captcha is not submitted that's why the tests are failing.

@LowLifeArcade
Copy link
Collaborator

@LowLifeArcade yes the form does not submit until the captcha is not submitted that's why the tests are failing.

It seems the sitekey is causing an issue too.
Screen Shot 2021-10-11 at 3 36 55 PM

@LowLifeArcade
Copy link
Collaborator

@akshitarora921 I've been meaning to talk with you about this PR. Will you please make a test or modify the test running on the MainDonationForm component? That needs to pass in your PR before we can do anything else.

@akshitarora921
Copy link
Contributor Author

@LowLifeArcade I am learning how to write tests, will update the PR as soon as possible.

@LowLifeArcade LowLifeArcade added help wanted Extra attention is needed high priority Help urgently needed and your PR will be reviewed extra quickly labels Oct 28, 2021
@akshitarora921 akshitarora921 marked this pull request as draft November 4, 2021 17:15
@LowLifeArcade
Copy link
Collaborator

@akshitarora921 I think it's time we get this one through :) It's really just a matter of making it pass the test file in the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted help wanted Extra attention is needed high priority Help urgently needed and your PR will be reviewed extra quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add captcha to give-device form
3 participants