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.

fix tokenCacheItemSchema

Steven Tey9dee0b59ee33
diff --git a/apps/web/lib/auth/partner.ts b/apps/web/lib/auth/partner.ts
index f8a5b5d9aa..493505e819 100644
--- a/apps/web/lib/auth/partner.ts
+++ b/apps/web/lib/auth/partner.ts
@@ -96,17 +96,7 @@ export const withPartnerProfile = (
},
select: {
expires: true,
- user: {
- select: {
- id: true,
- name: true,
- email: true,
- image: true,
- isMachine: true,
- defaultWorkspace: true,
- defaultPartnerId: true,
- },
- },
+ user: true,
},
});
}
diff --git a/apps/web/lib/auth/token-cache.ts b/apps/web/lib/auth/token-cache.ts
index 4d8deba1dc..9375c2d8b0 100644
--- a/apps/web/lib/auth/token-cache.ts
+++ b/apps/web/lib/auth/token-cache.ts
@@ -5,22 +5,23 @@ const CACHE_EXPIRATION = 60 * 60 * 24; // 24 hours
const CACHE_KEY_PREFIX = "dubTokenCache";
const tokenCacheItemSchema = z.object({
- scopes: z.string().nullish(),
- projectId: z.string().nullish(),
expires: z.date().nullish(),
- installationId: z.string().nullish(),
user: z.object({
id: z.string(),
name: z.string().nullable(),
email: z.string().nullable(),
isMachine: z.boolean(),
+ defaultWorkspace: z.string().nullish(),
defaultPartnerId: z.string().nullish(),
}),
+ scopes: z.string().nullish(),
+ projectId: z.string().nullish(),
project: z
.object({
plan: z.string().nullish(),
})
.nullish(),
+ installationId: z.string().nullish(),
});
export type TokenCacheItem = z.infer<typeof tokenCacheItemSchema>;
diff --git a/apps/web/lib/auth/workspace.ts b/apps/web/lib/auth/workspace.ts
index 74b42d0f76..d119a39f84 100644
--- a/apps/web/lib/auth/workspace.ts
+++ b/apps/web/lib/auth/workspace.ts
@@ -194,17 +194,7 @@ export const withWorkspace = (
},
},
}),
- user: {
- select: {
- id: true,
- name: true,
- email: true,
- image: true,
- isMachine: true,
- defaultWorkspace: true,
- defaultPartnerId: true,
- },
- },
+ user: true,
},
};