({ provider, providerAccountId })
| 44 | return account; |
| 45 | }, |
| 46 | async getUserByAccount({ provider, providerAccountId }) { |
| 47 | const account = await prisma.account.findUnique({ |
| 48 | where: { |
| 49 | providerId_providerAccountId: { |
| 50 | providerId: provider, |
| 51 | providerAccountId, |
| 52 | }, |
| 53 | }, |
| 54 | include: { user: true }, |
| 55 | }); |
| 56 | // Cast to AdapterUser to satisfy next-auth's adapter return type; |
| 57 | // the base PrismaAdapter returns the user row directly, and we mirror it. |
| 58 | return (account?.user ?? null) as AdapterUser | null; |
| 59 | }, |
| 60 | async unlinkAccount({ provider, providerAccountId }) { |
| 61 | await prisma.account.delete({ |
| 62 | where: { |
nothing calls this directly
no outgoing calls
no test coverage detected