What triggers the error GetUserByAccountError
when attempting to log in via SocialLogin with Github or Google? Here is a detailed description of the issue:
Unknown arg `provider_providerAccountId` in where.provider_providerAccountId for type AccountWhereUniqueInput. Did you mean `providerId_providerAccountId`? Available args:
type AccountWhereUniqueInput {
id?: String
providerId_providerAccountId?: AccountProviderId_providerAccountIdCompoundUniqueInput
}
Error:
Invalid `prisma.account.findUnique()` invocation:
{
where: {
provider_providerAccountId: {
~~~~~~~~~~~~~~~~~~~~~~~~~~
providerAccountId: '100794952997699653180',
provider: 'google'
}
},
select: {
user: true
}
}
(Additional stack trace details follow...)
{
name: 'GetUserByAccountError',
code: undefined
}
Steps I have taken to address this issue:
- Confirming if Prisma Studio functions correctly
- Verifying proper migration of the database
Reproduction Steps
In app/api/auth/[...nextauth]/route.ts:
(Code snippet from route.ts follows here...)
In schema.prisma:
(Schema definition from schema.prisma follows here...)
When selecting a Gmail account, for instance, I encounter the GetUserByAccountError
. The functionality should ideally work without issues. Is there something specific causing this error?