Skip to content

Commit

Permalink
Merge branch 'main' into fix/import-eventbrite-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
k-taro56 authored Aug 22, 2024
2 parents 5c345b3 + 71efac0 commit 3cceb81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/pages/getting-started/adapters/prisma.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ DATABASE_URL=postgres://postgres:[email protected]: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"
Expand All @@ -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
```

<Callout type="warning">
Expand Down
1 change: 1 addition & 0 deletions docs/pages/guides/role-based-access-control.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export default async function Page() {
return <p>You are not authorized to view this page!</p>;
}
```

</Code.Next>
<Code.NextClient>
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.
Expand Down

0 comments on commit 3cceb81

Please sign in to comment.