'next auth coinbase provider using prisma adapter doesn't add Account error created_at in data.created_at for type AccountUncheckedCreateInput
Seems like one data object in AccountUncheckedCreateInput is missing: data.created_at
Invalid p.account.create() invocation in
16 },
17 updateUser: ({ id, ...data }) => p.user.update({ where: { id }, data }),
18 deleteUser: (id) => p.user.delete({ where: { id } }),
→ 19 linkAccount: (data) => p.account.create({
data: {
xxx
}
})
Unknown arg created_at in data.created_at for type AccountUncheckedCreateInput. Available args:
type AccountUncheckedCreateInput {
id?: String
userId: String
type: String
provider: String
providerAccountId: String
refresh_token?: String | Null
access_token?: String | Null
expires_at?: Int | Null
token_type?: String | Null
scope?: String | Null
id_token?: String | Null
session_state?: String | Null
}
Solution 1:[1]
so to solve it a position in Object Account prisma model (or any) needs to be added: created_at Int?
then npx prisma db push and npx prisma generate, after this it works, so the main model needs to be replaced to be:
model Account {
id String @id @default(cuid())
userId String
type String
created_at Int?
provider String
providerAccountId String
refresh_token String?
access_token String?
expires_at Int?
token_type String?
scope String?
id_token String?
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |