Skip to content

Commit

Permalink
fix(nextjs): Add isApiRoute to AfterAuthHandler['auth'] type
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkl committed Jun 21, 2023
1 parent 7410125 commit 5dbe2aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-llamas-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/nextjs': patch
---

Add isApiRoute to AfterAuthHandler['auth'] type
2 changes: 1 addition & 1 deletion packages/nextjs/src/server/authMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type BeforeAuthHandler = (
) => NextMiddlewareResult | Promise<NextMiddlewareResult> | false | Promise<false>;

type AfterAuthHandler = (
auth: AuthObject & { isPublicRoute: boolean },
auth: AuthObject & { isPublicRoute: boolean; isApiRoute: boolean },
req: NextRequest,
evt: NextFetchEvent,
) => NextMiddlewareResult | Promise<NextMiddlewareResult>;
Expand Down

0 comments on commit 5dbe2aa

Please sign in to comment.