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.

Update options.ts

Steven Tey473407970c4e
diff --git a/apps/web/lib/auth/options.ts b/apps/web/lib/auth/options.ts
index e74f0b7bd3..c90ef57d89 100644
--- a/apps/web/lib/auth/options.ts
+++ b/apps/web/lib/auth/options.ts
@@ -190,7 +190,7 @@ export const authOptions: NextAuthOptions = {
if (account?.provider === "google" || account?.provider === "github") {
const userExists = await prisma.user.findUnique({
where: { email: user.email },
- select: { name: true, image: true },
+ select: { id: true, name: true, image: true },
});
if (!userExists || !profile) {
return true;
@@ -207,10 +207,9 @@ export const authOptions: NextAuthOptions = {
profilePic
) {
const { url } = await storage.upload(
- `avatars/${user.id}`,
+ `avatars/${userExists.id}`,
profilePic,
);
- console.log({ url });
newAvatar = url;
}
await prisma.user.update({