Does anyone have experience with <NextAuth> and su...
# orm-help
c
Does anyone have experience with NextAuth and successfully saving user data to Prisma from 3rd party providers? For example, signing in with Google, I get back the profile.picture and can log that it is indeed a correct URL string. But when trying to set that to store as
avatar
in my User model, it doesn’t seem to save. 🧵
My user model:
Copy code
model User {
  id            Int          @id @default(autoincrement())
  name          String?      @db.VarChar(200)
  email         String       @unique @db.VarChar(200)
  emailVerified DateTime?    @map(name: "email_verified")
  username      String?      @unique @db.VarChar(200)
  avatar        String?
}
and my Google provider code in
[…nextauth].js
Copy code
Providers.Google({
		clientId: process.env.GOOGLE_CLIENT_ID,
		clientSecret: process.env.GOOGLE_CLIENT_SECRET,
		profile(profile) {
			const user = {
				...profile,
				avatar: profile.picture
			}
			return user // Return the profile in a shape that is different from the built-in one.
		},
	}),