You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React.createContext() is being imported when calling verifyCloudProof() causing an error despite the function being called from a route.ts file as NextJS App API handler.
This happens when testing with the WorldID simulator.
Here is the rough implementation of the code
// /api/world-id/verify/route.tsimport{typeIVerifyResponse,verifyCloudProof}from'@worldcoin/idkit';import{NextRequest,NextResponse}from'next/server';exportconstPOST=async(req: NextRequest)=>{constproof=awaitreq.json();constapp_id=process.env.NEXT_PUBLIC_WORLD_ID_CLIENT_ID!as `app_${string}`;constaction_id=process.env.NEXT_PUBLIC_WORLD_ID_ZKP_ID!;try{constverifyRes=(awaitverifyCloudProof(proof,app_id,action_id,))asIVerifyResponse;if(!verifyRes.success){returnNextResponse.json(verifyRes,{status: 400});}returnNextResponse.json(verifyRes);}catch(error){console.log(error);returnNextResponse.json('Failed to verify',{status: 500});}};
Expected result
The route handler should compile normally and verify the proof received.
The text was updated successfully, but these errors were encountered:
IDKit version: 1.3.0
Framework: NextJS (App router)
Issues:
React.createContext()
is being imported when callingverifyCloudProof()
causing an error despite the function being called from aroute.ts
file as NextJS App API handler.This happens when testing with the WorldID simulator.
Here is the rough implementation of the code
Expected result
The route handler should compile normally and verify the proof received.
The text was updated successfully, but these errors were encountered: