Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

added user object to /api/me

Steven Tey5c6dde4e624b
diff --git a/apps/web/app/api/me/route.ts b/apps/web/app/api/me/route.ts
index 42c9c9f0aa..c673e8df8c 100644
--- a/apps/web/app/api/me/route.ts
+++ b/apps/web/app/api/me/route.ts
@@ -1,7 +1,13 @@
import { withAuth } from "@/lib/auth";
+import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
// GET /api/me - get the current user
export const GET = withAuth(async ({ session }) => {
- return NextResponse.json(session.user);
+ const user = await prisma.user.findUnique({
+ where: {
+ id: session.user.id,
+ },
+ });
+ return NextResponse.json(user);
});