-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown argument provider_providerAccountId
. Available options are marked with ?
#11205
Comments
is there updated for this? |
provider_providerAccountId
. Available options are marked with ?
I have finally solved the issue, So here's the steps I did.
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model Account {
id Int @id @default(autoincrement())
userId Int
type String
provider String
providerAccountId String
refresh_token String? @db.Text
access_token String? @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? @db.Text
session_state String?
createdAt DateTime @default(now()) @db.DateTime(0)
updatedAt DateTime @default(now()) @db.DateTime(0)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
}
enum UserRole {
Admin
Moderator
User
}
model User {
id Int @id @default(autoincrement())
name String?
email String? @unique
emailVerified DateTime?
image String?
password String?
role UserRole @default(User)
accounts Account[]
isTwoFactorEnabled Boolean @default(false)
twoFactorConfirmation TwoFactorConfirmation?
createdAt DateTime @default(now()) @db.DateTime(0)
updatedAt DateTime @default(now()) @db.DateTime(0)
}
model VerificationToken {
id Int @id @default(autoincrement())
email String
token String @unique
expires DateTime
@@unique([email, token])
}
model ResetPasswordToken {
id Int @id @default(autoincrement())
email String
token String @unique
expires DateTime
@@unique([email, token])
}
model TwoFactorToken {
id Int @id @default(autoincrement())
email String
token String @unique
expires DateTime
@@unique([email, token])
}
model TwoFactorConfirmation {
id Int @id @default(autoincrement())
userId Int @unique
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
|
Adapter type
@auth/prisma-adapter
Environment
Reproduction URL
https://github.com/mashwishi/mash-nextauth
Describe the issue
I'm encountering an issue with NextAuth's Prisma adapter. When attempting to use prisma.account.findUnique() with a specific where clause, I'm getting an error indicating an invalid argument provider_providerAccountId. The error message suggests using providerId_providerAccountId instead.
Here's the error message I'm receiving:
And here's my Prisma schema:
I haven't modified the Prisma schema generated by npx prisma db pull, so I believe this might be an issue related to the adapter or how NextAuth interfaces with Prisma.
Thank you for your help in resolving this issue! Let me know if you need any more information.
How to reproduce
Attempt to use google signin, Here's my auth implementation:
Expected behavior
The expected behavior would be for the Prisma adapter to recognize and accept the provider_providerAccountId argument in the where clause of the prisma.account.findUnique() invocation without throwing an error. This means that the Prisma adapter should handle queries with this argument properly and not suggest a different argument (providerId_providerAccountId) in the error message.
The text was updated successfully, but these errors were encountered: