zenstackhq / zenstack

Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
https://zenstack.dev
MIT License
2.07k stars 88 forks source link

[Doc] Update Clerk guide to Next.js app router #1419

Closed ymc9 closed 4 months ago

ymc9 commented 5 months ago

https://zenstack.dev/docs/guides/authentication/clerk

andrictham commented 4 months ago

@ymc9 I managed to get Clerk working with ZenStack and App Router

Here's what my code looks like in /src/app/api/model/[...path]/route.ts: https://gist.github.com/andrictham/1f4d729f33a63ab1fa817b40418f6e35

ymc9 commented 4 months ago

@ymc9 I managed to get Clerk working with ZenStack and App Router

Here's what my code looks like in /src/app/api/model/[...path]/route.ts: https://gist.github.com/andrictham/1f4d729f33a63ab1fa817b40418f6e35

Cool! Great to know that! I'll incorporate it into the docs.

Thank you for the help!

ymc9 commented 4 months ago

It's live here now: https://zenstack.dev/docs/guides/authentication/clerk#create-an-enhanced-prisma-client

The sample project also has two branches for the app router and pages router, respectively.

@andrictham

ymc9 commented 4 months ago

Fixed in v2.2.0