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.

Add workspace info to `api/oauth/userinfo`

Tim Wilson16a8e7136bcb
diff --git a/apps/web/app/api/oauth/userinfo/route.ts b/apps/web/app/api/oauth/userinfo/route.ts
index 2e38479adb..bfd27df983 100644
--- a/apps/web/app/api/oauth/userinfo/route.ts
+++ b/apps/web/app/api/oauth/userinfo/route.ts
@@ -26,6 +26,13 @@ export async function GET(req: NextRequest) {
image: true,
},
},
+ project: {
+ select: {
+ name: true,
+ slug: true,
+ logo: true,
+ },
+ },
},
});
@@ -42,6 +49,11 @@ export async function GET(req: NextRequest) {
id: user.id,
name: user.name,
image: user.image,
+ workspace: {
+ slug: tokenRecord.project.slug,
+ name: tokenRecord.project.name,
+ logo: tokenRecord.project.logo,
+ },
};
return NextResponse.json(userInfo);