The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Enforce and verify the returned contextId
Kiran K5b12a7b3feab
diff --git a/apps/web/app/(ee)/api/paypal/callback/route.ts b/apps/web/app/(ee)/api/paypal/callback/route.tsindex 65f8318793..402cf075d4 100644--- a/apps/web/app/(ee)/api/paypal/callback/route.ts+++ b/apps/web/app/(ee)/api/paypal/callback/route.ts@@ -32,7 +32,14 @@ export const GET = async (req: Request) => {throw new Error("partner_not_found");}- const { token } = await paypalOAuthProvider.exchangeCodeForToken(req);+ const { token, contextId } =+ await paypalOAuthProvider.exchangeCodeForToken(req);++ await prisma.user.findUniqueOrThrow({+ where: {+ id: contextId,+ },+ });const paypalUser = await paypalOAuthProvider.getUserInfo(token.access_token,