Skip to content

Refactor ComPilot providers to separate KYC and Signature Gating workflows - #452

Open
grmkris wants to merge 1 commit into
developmentfrom
feature/separate-compilot-providers
Open

Refactor ComPilot providers to separate KYC and Signature Gating workflows#452
grmkris wants to merge 1 commit into
developmentfrom
feature/separate-compilot-providers

Conversation

@grmkris

@grmkris grmkris commented Jun 16, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Separated ComPilot provider configuration for KYC and Signature Gating workflows
  • Created two distinct challenge functions that specify the workflow type
  • Implemented separate provider components to handle different workflow IDs properly

Changes

  1. Created separate challenge functions in compilot-config.ts:

    • generateChallengeKYC - adds workflowType: "kyc" to requests
    • generateChallengeSignatureGating - adds workflowType: "signatureGating" to requests
  2. Added provider components in src/providers/ComPilotProviders.tsx:

    • KYCComPilotProvider - uses KYC challenge function
    • SignatureGatingComPilotProvider - uses signature gating challenge function
  3. Updated _app.tsx:

    • Replaced single ComPilotProvider with both KYC and SignatureGating providers
    • Properly nested providers to allow components to use the appropriate one
  4. Modified /api/challenge endpoint:

    • Extracts workflowType from request body
    • Selects appropriate workflow ID based on type (KYC or Signature Gating)

Problem Solved

Previously, the workflow ID was being sent in two different places with potentially different values. This refactoring ensures that:

  • KYC functionality always uses WORKFLOW_KYC_ID
  • Signature Gating functionality always uses WORKFLOW_GATING_ID
  • The correct workflow ID is used consistently throughout the system

Test plan

  • Test KYC flow - Complete KYC button should use KYC workflow
  • Test minting flow - Both mint buttons should use Signature Gating workflow
  • Verify challenge endpoint correctly routes to appropriate workflow ID
  • Ensure no regression in existing functionality

🤖 Generated with Claude Code

…flows

- Created separate challenge functions for KYC and Signature Gating in compilot-config.ts
- Added KYCComPilotProvider and SignatureGatingComPilotProvider components
- Updated _app.tsx to use both providers with proper nesting
- Modified challenge API endpoint to handle workflowType parameter
- This ensures correct workflow IDs are used consistently throughout the system

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 16, 2025

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
nexeraid-example-airdrop-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 10:55am
nexeraid-examples-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 10:55am
thea-examples ❌ Failed (Inspect) Jun 16, 2025 10:55am

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.

1 participant