diff --git a/docs/pages/getting-started/adapters/prisma.mdx b/docs/pages/getting-started/adapters/prisma.mdx index e9c508ae55..6ce9615afa 100644 --- a/docs/pages/getting-started/adapters/prisma.mdx +++ b/docs/pages/getting-started/adapters/prisma.mdx @@ -26,6 +26,7 @@ DATABASE_URL=postgres://postgres:adminadmin@0.0.0.0:5432/db ``` ### Configuration + To improve performance using `Prisma ORM`, we can set up the Prisma instance to ensure only one instance is created throughout the project and then import it from any file as needed. This approach avoids recreating instances of PrismaClient every time it is used. Finally, we can import the Prisma instance from the `auth.ts` file configuration. ```ts filename="prisma.ts" @@ -35,7 +36,7 @@ const globalForPrisma = globalThis as unknown as { prisma: PrismaClient } export const prisma = globalForPrisma.prisma || new PrismaClient() -if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma +if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma ``` diff --git a/docs/pages/guides/role-based-access-control.mdx b/docs/pages/guides/role-based-access-control.mdx index 334a663dfb..f4178f233b 100644 --- a/docs/pages/guides/role-based-access-control.mdx +++ b/docs/pages/guides/role-based-access-control.mdx @@ -310,6 +310,7 @@ export default async function Page() { return

You are not authorized to view this page!

; } ``` + If you want to use the role on the client side, use the `useSession` hook. The `session.user.role` will contain the required role if you exposed it via the `session` callback.