PrismaP
Prisma17mo ago
1 reply
noynek2242

Row Level Security Example

I'm playing with this example on client extension and row-level-security (RLS). The thing that's got me confused is the example gets a user just by grabbing the first item
const user = await prisma.$extends(bypassRLS()).user.findFirstOrThrow();


I'm using next-auth and I can't figure out how to get the signed-in user from here. Any suggestions?

https://github.com/prisma/prisma-client-extensions/blob/main/row-level-security/script.ts#L42
GitHub
Examples of Prisma Client extensions. Contribute to prisma/prisma-client-extensions development by creating an account on GitHub.
prisma-client-extensions/row-level-security/script.ts at main · pri...
Was this page helpful?