I'm currently working on a project with the same stack: NextJS + Prisma + Postgresql and I started to implement this open source auth library:
Here is the documentation for implementing the library with NextJS:
https://supertokens.com/docs/thirdpartyemailpassword/nextjs/...
Btw, the library is backed by Ycombinator.