Extending the default PrismaAdapter you get
I want to extend the default prisma adapter to be able to award a badge to the first 100 users to sign up for my site. Unfortunately, the following code actually breaks nextjs entirely and becomes a zombie process. Not quite sure what I'm doing wrong here:
Then later on
`
export const authOptions: NextAuthOptions = {
{...}
adapter: extendedAdapter(db),
{...}
}
Solution:Jump to solution
Was able to make it work like this:
```
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import { Award, type PrismaClient } from "@prisma/client"...
2 Replies
I'm suspecting that the adapter's
createUser
is opening a transaction that I'm not tapping into, creating a softlock?Solution
Was able to make it work like this: