Skip to content

Conversation

@tesol2y090
Copy link

Changes

  • Added Google reCAPTCHA v2 (Checkbox) integration
  • Implemented client-side reCAPTCHA verification
  • Added server-side reCAPTCHA token validation
  • Added environment variable configuration for reCAPTCHA keys
  • Added error handling for reCAPTCHA verification
  • Added reCAPTCHA reset after successful claims

Implementation Details

  1. Client-side:

    • Added react-google-recaptcha package
    • Implemented reCAPTCHA checkbox component
    • Added token verification before API calls
    • Added error handling and user feedback
  2. Server-side:

    • Added reCAPTCHA token verification endpoint
    • Added error handling for invalid tokens
    • Integrated verification with existing faucet logic

Environment Variables

Add the following to your .env.local:

NEXT_PUBLIC_RECAPTCHA_SITE_KEY=your_site_key_here
RECAPTCHA_SECRET_KEY=your_secret_key_here

Notes

  • Requires reCAPTCHA v2 keys from Google reCAPTCHA admin console
  • Make sure to add your domain (including localhost) to allowed domains in reCAPTCHA settings
  • The site key should start with 6L for reCAPTCHA v2

Screenshots

Screenshot 2568-03-19 at 01 01 32

Close #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add reCAPTCHA to Faucet Claim Process

1 participant