Skip to content

Conversation

@aXenDeveloper
Copy link
Owner

Improving Documentation

Description

What?

Why?

How?

@vercel
Copy link

vercel bot commented Jun 29, 2025

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

Name Status Preview Comments Updated (UTC)
vitnode-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 29, 2025 5:10pm
vitnode-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 29, 2025 5:10pm

@github-actions github-actions bot added the 💡 Feature A new feature label Jun 29, 2025
@aXenDeveloper aXenDeveloper requested a review from Copilot June 29, 2025 11:16

This comment was marked as outdated.

@aXenDeveloper aXenDeveloper marked this pull request as ready for review June 29, 2025 16:55
@aXenDeveloper aXenDeveloper requested a review from Copilot June 29, 2025 16:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds CAPTCHA support across the API and UI, integrating a new useCaptcha hook, middleware, request headers, and documentation updates.

  • Introduce captcha config in vitnode.config.ts and application entrypoints
  • Implement captchaMiddleware and integrate it in buildRoute
  • Add useCaptcha React hook and wire CAPTCHA through AutoForm, sign-up, and sign-in flows
  • Update fetchers to pass CAPTCHA tokens via x-vitnode-captcha-token header
  • Revise documentation to cover CAPTCHA setup and usage

Reviewed Changes

Copilot reviewed 33 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/vitnode/src/hooks/use-captcha.ts Implements CAPTCHA widget loader and token retrieval
packages/vitnode/src/components/form/auto-form.tsx Wires CAPTCHA into AutoForm and submit flow
packages/vitnode/src/api/lib/route.ts Conditionally adds captchaMiddleware via withCaptcha
packages/vitnode/src/api/middlewares/captcha.middleware.ts New middleware to verify CAPTCHA tokens
packages/vitnode/src/vitnode.config.ts Adds captcha settings to API config interface
packages/vitnode/src/views/auth/sign-up/… Passes CAPTCHA config and token into sign-up forms
packages/vitnode/src/views/auth/sign-in/… Prepares sign-in form to accept CAPTCHA (if needed)
apps/docs/content/docs/guides/captcha/** Adds comprehensive guides for Google and Cloudflare
apps/web/src/vitnode.api.config.ts Configures CAPTCHA provider (reCAPTCHA v3)
Comments suppressed due to low confidence (2)

packages/vitnode/src/views/auth/sign-in/form/use-form.ts:6

  • [nitpick] Consider using the @/components/form/auto-form alias instead of a deep relative path for consistency with other modules and better maintainability.
import type { AutoFormOnSubmit } from '../../../../components/form/auto-form';

});

const onSubmit = async (values: z.infer<typeof formSchema>) => {
const onSubmit: AutoFormOnSubmit<typeof formSchema> = async values => {
Copy link

Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

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

The AutoFormOnSubmit signature expects (values, form, options) but the handler only takes values. Update to async (values, form, options) => { … } to match the type.

Suggested change
const onSubmit: AutoFormOnSubmit<typeof formSchema> = async values => {
const onSubmit: AutoFormOnSubmit<typeof formSchema> = async (values, form, options) => {

Copilot uses AI. Check for mistakes.
@aXenDeveloper aXenDeveloper merged commit e1f3a98 into canary Jun 29, 2025
3 of 5 checks passed
@aXenDeveloper aXenDeveloper deleted the captcha branch June 29, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 Feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants