import {NextRequest, NextResponse} from 'next/server'
import {getCap} from '@/lib/cap'

export async function POST(req: NextRequest) {
  const body = await req.json()
  const cap = await getCap()
  const result = await cap.redeemChallenge(body)
  return NextResponse.json(result)
}
