import { handleGoogleCallback } from "@/lib/headless/providers/medusa-customer"; export async function POST(request: Request) { const { code, state } = await request.json(); if (!code || !state) { return Response.json({ error: "Faltan parĂ¡metros de Google" }, { status: 400 }); } try { const customer = await handleGoogleCallback(code, state); return Response.json(customer); } catch (error) { return Response.json({ error: (error as Error).message }, { status: 400 }); } }