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 default scope

Kiran K400189e09ad6
diff --git a/apps/web/app/api/oauth/userinfo/route.ts b/apps/web/app/api/oauth/userinfo/route.ts
index 4cf62c901f..d057e7d878 100644
--- a/apps/web/app/api/oauth/userinfo/route.ts
+++ b/apps/web/app/api/oauth/userinfo/route.ts
@@ -43,7 +43,6 @@ export async function GET(req: NextRequest) {
id: user.id,
email: user.email,
name: user.name,
- avatar_url: user.image,
};
return NextResponse.json(userInfo);
diff --git a/apps/web/app/app.dub.co/(auth)/oauth/authorize/scopes-requested.tsx b/apps/web/app/app.dub.co/(auth)/oauth/authorize/scopes-requested.tsx
index ff8203c361..05ea208fd9 100644
--- a/apps/web/app/app.dub.co/(auth)/oauth/authorize/scopes-requested.tsx
+++ b/apps/web/app/app.dub.co/(auth)/oauth/authorize/scopes-requested.tsx
@@ -8,6 +8,11 @@ interface ScopesProps {
}
export const ScopesRequested = ({ scopes }: ScopesProps) => {
+ // Add default scopes if not present
+ if (!scopes.includes("user.read")) {
+ scopes.push("user.read");
+ }
+
const scopeWithDescriptions = scopes.map((scope) => {
return {
scope,
diff --git a/apps/web/lib/api/oauth/constants.ts b/apps/web/lib/api/oauth/constants.ts
index ca3694e555..9d23e62d42 100644
--- a/apps/web/lib/api/oauth/constants.ts
+++ b/apps/web/lib/api/oauth/constants.ts
@@ -26,12 +26,11 @@ export const OAUTH_SCOPES = [
"analytics.read",
"domains.read",
"domains.write",
- "users.read",
+ "user.read",
];
// Scope descriptions
export const OAUTH_SCOPE_DESCRIPTIONS = {
- "users.read": "Read access to your profile",
"workspaces.read": "Read access to workspace",
"workspaces.write": "Read and Write access to workspace",
"links.read": "Read access to links",
@@ -41,4 +40,5 @@ export const OAUTH_SCOPE_DESCRIPTIONS = {
"analytics.read": "Read access to analytics and events",
"domains.read": "Read access to domains",
"domains.write": "Read and Write access to domains",
+ "user.read": "Read access to your profile (name and email)",
};