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

[Dashboard] Add Cloudflare Turnstile to Faucet page #5067

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Oct 17, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces support for Cloudflare Turnstile captcha in the faucet functionality of the dashboard application, enhancing security during claims. It also updates dependencies and configuration files to accommodate these changes.

Detailed summary

  • Added TURNSTILE_SITE_KEY constant in env.ts.
  • Updated API_SERVER_SECRET and added new environment variables in .env.example.
  • Modified next.config.js to allow Cloudflare's challenges.
  • Updated POST request in route.ts to include turnstileToken.
  • Implemented server-side validation for Turnstile token.
  • Updated FaucetButton.tsx to integrate Turnstile captcha and form handling.
  • Changed mutation function to accept turnstileToken.
  • Added validation schema for the form using zod.
  • Updated dependencies in package.json and pnpm-lock.yaml.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Oct 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 5:52am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 5:52am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 5:52am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 5:52am

Copy link

changeset-bot bot commented Oct 17, 2024

⚠️ No Changeset found

Latest commit: 0dd1438

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

graphite-app bot commented Oct 17, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 17, 2024
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @kien-ngo and the rest of your teammates on Graphite Graphite

@kien-ngo kien-ngo changed the title Update [Dashboard] Add Cloudflare Turnstile to Faucet page Oct 17, 2024
@kien-ngo kien-ngo marked this pull request as ready for review October 17, 2024 12:20
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.29%. Comparing base (0f4e662) to head (0dd1438).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5067   +/-   ##
=======================================
  Coverage   45.29%   45.29%           
=======================================
  Files        1059     1059           
  Lines       54728    54728           
  Branches     3954     3954           
=======================================
  Hits        24791    24791           
  Misses      29246    29246           
  Partials      691      691           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 0f4e662
packages 40.24% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Copy link
Contributor

github-actions bot commented Oct 17, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.81 KB (0%) 857 ms (0%) 3.4 s (+29.07% 🔺) 4.2 s
thirdweb (cjs) 102.66 KB (0%) 2.1 s (0%) 5.3 s (-2.53% 🔽) 7.3 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 219 ms (-3.67% 🔽) 316 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 56 ms (+30.24% 🔺) 66 ms
thirdweb/react (minimal + tree-shaking) 17.36 KB (0%) 348 ms (0%) 484 ms (+47.21% 🔺) 831 ms

@kien-ngo kien-ngo added the DO NOT MERGE This pull request is still in progress and is not ready to be merged. label Oct 17, 2024 — with Graphite App
Copy link

graphite-app bot commented Oct 18, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces support for Cloudflare Turnstile captcha validation in the faucet functionality of the dashboard application, enhancing security during fund claims. It also updates dependencies and configuration for the new feature.

### Detailed summary
- Added `TURNSTILE_SITE_KEY` constant to `env.ts`.
- Updated `package.json` to include `@marsidev/react-turnstile`.
- Modified `.env.example` to add `NEXT_PUBLIC_TURNSTILE_SITE_KEY` and `TURNSTILE_SECRET_KEY`.
- Updated `next.config.js` to allow scripts from Cloudflare.
- Enhanced `POST` handler in `route.ts` to validate `turnstileToken`.
- Updated `FaucetButton.tsx` to integrate Turnstile captcha and form handling.
- Introduced `claimFaucetSchema` for form validation using `zod`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard. DO NOT MERGE This pull request is still in progress and is not ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants