The product API example permits database creation without authentication or authorization and passes through the whole request body
Source references: 1The POST handler parses caller-supplied JSON and passes it directly to db.product.create. It shows no authentication, role check, field allowlist, or schema validation.
If used directly in an accessible route, anyone able to call it could create products or supply extra fields affecting controlled properties such as price, ownership, or publication status.
This is a documentation example, not executing code, but the skill presents patterns for building full-stack features. If copied as shown, any caller able to reach the POST endpoint can pass arbitrary JSON directly into product creation. No authentication, create permission, field allowlist, or schema validation is shown, which could permit unauthorized records or writes to sensitive fields. Users can ask the author to add authentication, role authorization, and a strict input schema, or restrict this example from direct production use.
export async function POST(request: NextRequest) { const body = await request.json(); const product = await db.product.create({ data: body, }); return NextResponse.json(product, { status: 201 });}