Build failing for correct field type in OAuth Provider response #11302
-
I am using Google for Oauth and have implemented the Here is my implementation for the same async signIn({profile}) {
if (!profile?.email) {
throw new Error('No email associated with the email profile');
}
await prisma.users.upsert({
where: {
email: profile.email
},
create: {
id: profile.sub as string,
email: profile.email,
name: profile.name,
avatar: profile.picture,
},
update: {
name: profile.name,
avatar: profile.picture,
},
});
return true;
} I receive an error when doing a build
But if I replace the model Users {
id String @id @unique
email String @unique
name String?
avatar String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("users")
} Here are the redacted logs for debug purpose https://gist.github.com/onlinejudge95/5bc5f50e78d548661de47621e37d5dd8 EDITAdding debug logs to prove that picture field does exist in the response schema |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Why did you decide to use |
Beta Was this translation helpful? Give feedback.
-
This seems to be a problem with DB, not next-auth. |
Beta Was this translation helpful? Give feedback.
I think this will work perfectly!